Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Dale Dedoroy
  Where is Dale Dedoroy?
 Bacolod City, Negros Occidental
 Philippines
 Dale Dedoroy
 To: chris smith
  Where is chris smith?
 Yorkshire CH CH
 Barbados
 chris smith
 Tags
Subject: RE: What is trans()
Thread ID: 727 Message ID: 774 # Views: 1 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Wednesday, June 13, 2001 8:30:08 PM         
   


> > >
> > > Thanks for your response. I'm using vfp5 an it does not have a trans() what does it do?
> > > smith
> >
> > Hello,
> >
> > trans() = transform()
> >
> > --
> > Eric den Doop
> > www.foxite.com - The Home Of The Visual FoxPro Experts
>
> Ha guys
> I modified the code just a little because I want to expand or contract the grid1 columns for all the character fields in the cursor. However I'm getting a syntax error at the line begining with lnMaxLength = IIf...............
> My changes are shown below.
> Can anyone help.
> **************************
> sele mycursor
> Local lnMaxLength
> lnMaxLength = 0
> for fnum = 1 to fcount()
> fc = field(fnum)
> if type('&fc') = "C"
> Scan
> lnMaxLength = IIf(Len(AllTrim(Transform(&fc))) > lnMaxLength,Len(AllTrim(Transform(&fc))),lnMaxLength)
> EndScan
> endif
> j = "column"+allt(str(fnum))
> thisform.grid1.&j..width = lnMaxLength + 10
> endfor
> **************************
>
> smith

Hi Smith,
I tested your code (direct cut and paste) and did not find any syntax error to it except that you don't have to use a macro subtitution in Type('&fc'). You can write it like Type(fc) since macroing can slow down your app, except, of course, as the last effective recourse. Are you sure the error is in the IIf... line? Is it possible that you made some changes and compiled your app to an EXE and whenever you run newly modified prg or form, the EXE is executed instead that then triggers the error? If this is correct, erase the exe or re-compile your app.

Hth,
Dale

ENTIRE THREAD

grid column width Posted by chris smith @ 6/12/2001 10:20:30 PM
RE: grid column width Posted by Dale Dedoroy @ 6/12/2001 11:20:36 PM
RE: What is trans() Posted by chris smith @ 6/13/2001 9:19:21 AM
RE: What is trans() Posted by Eric den Doop @ 6/13/2001 9:32:10 AM
RE: What is trans() Posted by chris smith @ 6/13/2001 10:18:53 AM
RE: What is trans() Posted by Dale Dedoroy @ 6/13/2001 8:30:08 PM
RE: Dale this is for you Posted by chris smith @ 6/14/2001 9:52:55 AM
RE: Dale this is for you Posted by Dale Dedoroy @ 6/14/2001 10:38:31 PM