Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mem variables in PADL()
Message
From
12/02/2001 00:52:44
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australia
 
 
To
11/02/2001 23:46:54
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00474880
Message ID:
00474881
Views:
15
Hi Tom,
   Try SCATTER MEMVAR ( 'SCATTER TO MEMVAR' as you've coded in you example will
create an array called MEMVAR ) then PADL(ALLTRIM(m.gcn),5,'0'). You need to
remove the leading spaces from m.gcn for PADL to work in your example.

   Or you could try:

   SELECT PADL(ALLTRIM(b),5,'0') AS gcn ;
      FROM mytable ;
      INTO CURSOR mycursor
Hope this helps,
Gavin...

>Heres what I am trying to do.
>I have imported a worksheet from excel, and have created a select statement
>of
>select b as GCN, c as NDC, e as BegDate, f as EndDate, g as MWP.
>This creates me a table I can play with
>I then skip the first record, then with a do while go to work on each record then
>copy to file type sdf.
>
>That seems to go okay but I am trying to get the fields in the table to change to a certain spec, and I am missing it.
>
>The fields MUST be this length.
>GCN 5
>ICN 11
>BegDate 8
>EndDate 8
>MWP 4.5
>and if they are not they must have '0' as placeholders from the left.
>ie GCN of 4567 becomes GCN of 04567.
>
>I tried to
>
>Scatter to memvar
>PADL(m.GCN, 5,'0') && it did nothing.
>Gather
>
>This could not find the variable GCN. There is something simple I am missing.
>
>So I tried just PADL(GCN,5,'0') and no changes occurred.
>
>am I using the wrong function or am I doing something awkward with the mem VARS?
>
>Thanks.
>
>Tom
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform