PDA

View Full Version : A Newbie in need of Help...


ABC123

1974
01-19-2009, 09:03 PM
Hi Everyone
I like much of you, have finally started the transaction from A4 to A5. I have used an Application I made for probably 8 years in my work and it has served us well. But new Computers and operating systems has forced me to this point. I have found this site extremely helpful. But I have run into a problem that I can't find an answer. I have never written code for anything and that may be my biggest issue. So here we go.... I am trying to use data in a field as a file name in another program and have that program and file open with a Button.. Example, Field (ID) contains a 6 digit number (209001) this coincides witha Wordpad file named (209001.rft). I would like the button to launch Wordpad and put in the filename (209001) and open the file...
Is this possible? I can get the Wordpad to launch from a button, easy...
Then go (File) (Open) type in (209001) and it will open. I have also gotten a Button to put the (209001) into a variable and then tried opening a file. But it always returns (File 209001 not present) or something close to that. Could it be it doesn't know the file path like (C:\alpha5data\layouts)?
Any help would be greatly appreciated....
Thank You
Bill (1974)

Stan Mathews
01-19-2009, 09:16 PM
Context is important. Do you have a form open with the id field showing? Is the objectname of the id field also object?

sys_open(pathtofile+chr(92)+id.value+".rtf")

would be the code for a button assuming all the rtf files are stored in the same directory.

In your example pathtofile would be "C:\alpha5data\layouts"

The objectname is revealed by examining its properties.

1974
01-19-2009, 09:42 PM
Context is important. Do you have a form open with the id field showing? Is the objectname of the id field also object? sys_open(pathtofile+chr(92)+id.value+".rtf")

would be the code for a button assuming all the rtf files are stored in the same directory.

In your example pathtofile would be "C:\alpha5data\layouts"

The objectname is revealed by examining its properties.

Question 1 Yes...
Question 2 What? (I'm a Newbie)

Thank you

Stan Mathews
01-19-2009, 11:00 PM
The objectname is revealed by examining its properties. Select (left click on while in design mode) the id field as represented on the form. Right click on the object and examine the object name. (http://support.alphasoftware.com/alphafivehelpv8/Webhelp_Only_Images/UG_Field_Setup_Properties.gif) (in the area under the heading "Field Description".

1974
01-22-2009, 12:15 AM
Hi Stan
You Rock, The code you sent me worked perfect. You are the Man......