Normal Topic advice needed using @text()/@len()/@chr() (Read 13598 times)
beagle
Junior Member
**
Offline


No personal text

Posts: 80
Location: australia
Joined: May 28th, 2004
advice needed using @text()/@len()/@chr()
Feb 6th, 2005 at 7:53am
Print Post Print Post  
Hi,
I'm looking for some advice after trying most of the weekend I just cant seem to get the hang of the @len() & @chr() commands.

what i'm trying to do is, retrive a number of sub records into a single list "vlist" & then pass via xpost to an element in another database via the xpost function.

I can do this however i want to make the list a columnar list so that it is easy to read.


curently my output reads like


123    first item
1234    second item
12345    third item


how I want it to look is


123          first item
1234    second item
12345   third item

my current programing reads (i've italisised the relevant programing)

Var vDescription as string
Var vPos as int
Var vSub as int
Var vSubTotal as int
var vlist as string
var vlen as int

//Loops through the Subrecords
vSubTotal = @FormResultSetTotal("item")     //counts # of records in form/subform
vSub = 1                                    //sets counter to 1
While vSub <= vSubTotal
{
     VDescription = @FormFieldValue("item", "item", vSub)
     vlen=(7-(@len("item#")))      
     FormResultSetCurrentPosition("item", vSub)
     vlist = vlist +               
     
     @FormFieldValue("item", "item#", vSub) + @txt(vlen,@chr(32))+
     @FormFieldValue("item", "description", vSub) +"; " +
     @FormFieldValue("item", "dose", vSub) + "; "+
     @FormFieldValue("item", "offer$", vSub)+ "; "+
     //@FormFieldValue("item", "source", vSub)+
     
     @newline()
     vSub = vSub + 1                   //increases counter value by 1 (see above)
}

FormResultSetCurrentPosition("item", 1)

writeln(vlist)


any advice as to where i'm going off the rails would be most appreciated.


  
Back to top
 
IP Logged
 
beagle
Junior Member
**
Offline


No personal text

Posts: 80
Location: australia
Joined: May 28th, 2004
Re: advice needed using @text()/@len()/@chr()
Reply #1 - Feb 6th, 2005 at 8:49am
Print Post Print Post  
I guess the above is an example of trying too hard to "make" an approch to a problem "work"  Roll Eyes

after a break I came back & read details about the TAB(n) command

using the TAB(n) command in my programming exactly how I want.  Grin

1 up to Sesame !
  
Back to top
 
IP Logged