Jump to content

Get(FileName) not working


Genx
 Share

This topic is 5667 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Umm, yeh, my get(filename) function doesnt seem to be returning the filename. It's a bit of a pain having to type it out when im trying to get value list items in... Just wondering if anyone else has this problem

FM8 Advanced, v8.03

Link to comment
Share on other sites

My get value list items function wasnt working with Get(filename) so i decided to test it in the data viewer... no luck.

The file is the client side (front end) of a solution - i tested it with a local file, this works.

I also tested it with the front end (while not connected to the network) and pointed to a very recent version of the backend but locally --> this also worked.

Perhaps it has to do in something to do with remote backend (this was tested over a vpn though it shouldnt matter).

If someone else could test this it would be great... its just a bit of a pain having to type in the whole filename.

Cheers,

~Genx

Link to comment
Share on other sites

Just to get the facts straightned slightly, what you attempted to do was similar to this:

Show Custom Dialog [ Title: "Which list..."; Message: "....do you wish to get data from "; Buttons: “pling”, “ Clone” ] 

Set Field [ pling::reciever; ValueListItems ( GetValue( DatabaseNames ; Get ( LastMessageChoice ) ) ; "New Value List" ) ] 

...my point would have been that if a file isn't referenced by the subscriber file won't it show up in list "DatabaseNames" makes.

--sd

Link to comment
Share on other sites

I experienced a similar problem with the Get(filename) in a valuelist function. I also run FM8A on an XP box. I was able to trigger the calculation by concatenating additional info into the function. Once it was working again I replaced it with the origianl formula and it has worked without flaw ever since. I am not ready to call it a bug, but it is on my suspect list.

Link to comment
Share on other sites

Genx,

ValueListItems ( Get ( FileName ) & ".fp7" ; "ValueList" )

I realize this is not required, but it did trigger the calculation to work. Once it was working I removed the ".fp7" and have not had any trouble since.

Link to comment
Share on other sites

If anyone else comes accross this problem, you can a) use the solution above (and because im too lazy i did) :P :P you can make a custom function or just a calc to parse out the filename from get(filepath) function.

Link to comment
Share on other sites

Is there a Mac user out there who could test these formulae?

ValueListItems ( Get ( FileName ) & ".fp7" ; "ValueList" )

vs.

ValueListItems ( Get ( FileName ) ; "ValueList" )

My thought is the file extention not being required on a Mac as it is on PC.

Link to comment
Share on other sites

hold on, have you got view file extensions of known file types turned on in your control panel under view options... because i do, and i think that might be it.

Link to comment
Share on other sites

I believe the Get(filename) function mis-handles file names with periods (.) in them. It stops at the first period. So a file named "class_contacts.fp7" will return the expected result, but "class.contacts.fp7" will not.

This might be considered a bug in the function, but who in their right mind puts periods in file names? :

Link to comment
Share on other sites

Sorry, wait... yes i do. Thats just cause it was Filename v2.0.fp7 .. as per whether a sane person would do it, apparently microsoft thinks so otherwise it wouldn't allow the character to be used...

Link to comment
Share on other sites

The fact that Microsoft allows something is no indication of its sanity. It is just generally bad practice to use symbols, names or anything elses that have special meanings/uses. You can often get away with it for ages and suddenly it will bite you.

Link to comment
Share on other sites

Yet still, FM was built to be compatible with Windows so therefore it should support filenaming standards that windows supports - whether these are sane or not, it is not for FM to judge.

Link to comment
Share on other sites

There is a great resource on the filemaker.com web site called the "FileMaker Development Conventions". Over a dozen of the best developers in the FileMaker market got together and defined good standards for fields, tables, files, scripts, etc. It's quite specific at nearly 100 pages but is worth a read to at least start your own system of standards.

In the section on file naming standards, there are 10 important points everyone should follow when naming a FileMaker file. Here are two of the points from the white paper:

4. Should NOT use file name to indicate versions.

5. Should NOT contain periods other than the single period used for the extension.

If you would like your own copy of the "FileMaker Development Conventions", visit the following URL:

http://www.filemaker.com/downloads/pdf/FMDev_ConvNov05.pdf

Link to comment
Share on other sites

Oh well, i'm a bit un filemaker developer convention comformist... i'll have to take this in to account in future but at the moment i have to stick with what i'm using for the plain reason that i reference the filename indirectly in a few spots in the database and i don't want to induce any unwarranted bugs into my system from calcs that don't evaluate properly anymore.

Anyway, cheers, i'll make sure i have a good read through it when i get some time.

Link to comment
Share on other sites

Oh right, also, its not really indicating a version number per say, i.e. i don't change it on updates. V1 was just a hunk of junk so i rebuilt it and named the whole thing version 2. Though i suppose it could have done without the period-zero.

Link to comment
Share on other sites

This topic is 5667 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.