GetFileName problem
Dear All,
I've two tables and each one has a button.
Table #1 , Button 1
Action:
Execute Function/Derivation
SetValue("path_Imagem",GetFileName("","",GetCurrent(GetVAr("pathImagens")))))
Table #2 , Button 2
Action:
Execute Function/Derivation
SetValue("path_Documents",GetFileName("","",GetCurrent(GetVAr("pathDocuments")))))
Both variables "pathImagens" and "pathDocuments" are assigned to a different path with SetVAr Function at the initial display of apllication, as follows:
SG := SetVar ( "pathDocumentos" , Path_Documentos ) .
SG := SetVar ( "pathImagens" , Path_Imagens ) .
The problem with these instructions on each button is that they don't open the right folder.
To get the correct folder I need to choose it manually . Then, that path stay fixed .
Example:
When I press button #1 I should targeted to folder with images. But, if for some reason I have previously chosen the folder documents the application open the window with the folder of documents and not the images. The opposite is also valid.
Any idea what is wrong with this ?
Thanks
Afonso
A small sample that showcase the problem is necessary for us to spend the time to look into it, it is so many possible sources for error that it is a waste of time for us to try to replicate the problem based on just a small part of the environment.
Please remember to ALWAYS include a small app that specifically showcase the problem and nothing else.
This problem can be anything for a misspelling to a missing \ or and extra \ etc. We need to see the "not working" code to be able to make a call.
Please check this example:
table t_entrada_principal - start here in order to initializing variable paths
table t_parametros_sistema where we can define the folder's path
table t_teste with 2 buttons one for each folder
thanks
AS
Hallo Afonso,
did you also checked the rigth names e.g. Objeknames and Fieldnames ! Or maybe the writing of the Variabels in the scripts.
An option e.g. to check step by step to lokate the problem..... ;)
Good luck....
Markus
Re:Re:Re:Re:GetFileName problem
All verified. Problem still happening
Thanks
AS
Re:Re:Re:Re:Re:GetFileName problem
Problem is that you confuse two different functions:
GetCurrent() will retrieve a system variable, and the input for it is WHICH system variable you want to retrieve.
GetCurrent("MyDocuments") will return the path to your Documents, GetCurrent("Height") will return the height of the main window etc.
GetFileName() will need the string representation of the Path as Argument 3.
SetValue("path_Documents",GetFileName("","",GetCurrent(GetVAr("pathDocuments")))))
GetCurrent(GetVAr("pathDocuments")) makes no meaning as it will return BLANK.
Simply: GetFileName("","",GetVAr("pathImagens")) will give you the result you are looking for.
Re:Re:Re:Re:Re:Re:GetFileName problem
Sorry, but after making the changes you sugest, the results are the same.
It works "sometimes"
Re:Re:Re:Re:Re:Re:Re:GetFileName problem
Then your problem is that you for some reason don't get an existing path etc in your parameters.
I also saw that you have too many end parentheses, that might affect something.
We use this function all the time and have had no problems at all, it is also a function that is close to 20 years old without any reported problems so the problem is almost guaranteed in your code and not the function.
Build it from scratch and see if you get the same problem.