Problem with Dots in Filenames and Lookups
Nancy Palmquist
nlp at vss3.com
Mon Mar 28 12:27:59 PST 2005
Mike Rathburn wrote:
> fP ODBC v1 on Winderz
>
> We did a conversion from UNIX to Windows, and now a specific report will
> give a syntax error. The report is being run from a file called pr.trx.
> The syntax error is coming from the code below, putting the pointer where
> the filename's dot is (as if it doesn't like the filename with a dot in it).
>
> This report still runs fine from the old 4.5 UNIX system. Only bombs on the
> fPODBC v1 Windows system. What's weird is that apparently (so far) there
> seems to be no other issues with filenames and dots in those filenames.
> There are a gozillion other lookups in other processing tables, input and
> output.
>
> If:
> Then: lookup ap.initems k=ud i=e -ng
> loopdes If: not ap.initems
> Then: return
> If: ap.initems(1) ge ud+"100"
> Then: return
> If:
> Then: ub(9,.2)=ap.initems(3)*ap.initems(5)
> If: ap.initems(24) ne 1
> Then: getnext ap.initems; goto loopdes
>
> The syntax error looked like:
>
> ap.initems(1) ge ud+"100"
> ^
>
> At any rate, I changed the lookup to:
>
> lookup apinitems = ap.initems k=ud i=e -ng
>
> and subsequent references to the lookup variable, and now all is well.
> There was one other lookup in this particular output processing table that
> looked like:
>
> lookup ap.po k=6 i=e -nx
>
> That I also had to change to a variable for the same reason.
>
> Any idea as to why this particular lookup with a dot in the filename would
> produce a syntax error?
>
> -MikeR
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
>
I can understand this. Windows naming assumes the . indicates the
beginning of an extension. Directories do not usually have . in the name.
I have also seen menu names barf when they had . in the main menu name
since filePro uses the extension for adding scripts you get names like
this: main.menu.-F
Not sure if windows understands such a thing.
I would suggest the following to make the changes minimul:
Copy (using filePro fpCopy) the file from ap.initems to ap_initems
If:
> Then: lookup ap.initems=ap_initems k=ud i=e -ng
By just changing the lookup and leaving the old name as the alias only
the lookup lines need to be changed. All the references to the lookup
will not require any change.
Other changes would be the menus and you would just change all the .'s
to _'s in one swoop.
For just such a reason, when I develop in Unix or Windows I try to live
within the naming limits and rules for both. It makes life easier down
the road.
As a rule, I would try to avoid names that contain . on either system,
use a dash or underscore instead. Other symbols can get you in trouble
such as + (which works on UNIX but on DOS is a function for concatenation.)
This is one of the gotcha's when you change platforms. At least you
should be thankful that the Windows version understands long filenames
these days. I did a bunch of these when it did not and you had to go
find and shorten all the references to a filename that exceeded 8
characters.
Nancy
--
Nancy Palmquist MOS & filePro Training Available
Virtual Software Systems Web Based Training and Consulting
PHONE: (412) 835-9417 Web site: http://www.vss3.com
More information about the Filepro-list
mailing list