Hi folks,
Is there a way to write something like:
string dictName = "SD_PROF_10_ENTREVISTA_DICT";
setfile(dictName, "file.csdb");
I need to set the dictionary in a function depending on a parameter.
Best
Ari
Using the dict name coming from a string variable
-
AriSilva
- Posts: 633
- Joined: July 22nd, 2016, 3:55 pm
-
Gregory Martin
- Posts: 1977
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Using the dict name coming from a string variable
There are a lot of times it would be nice to use a string variable to specify a dynamic dictionary / variable / etc., but unfortunately that's only supported in a few places. Your best bet would be to create a dummy function like:
function SetDictionaryFile(string dictionaryName, string filePath)
when dictionaryName;
"DICT1" -> setfile(DICT1, filePath);
"DICT2" -> setfile(DICT2, filePath);
"DICT3" -> setfile(DICT3, filePath);
endwhen;
end;
when dictionaryName;
"DICT1" -> setfile(DICT1, filePath);
"DICT2" -> setfile(DICT2, filePath);
"DICT3" -> setfile(DICT3, filePath);
endwhen;
end;
-
htuser
- Posts: 692
- Joined: December 19th, 2011, 6:26 pm
- Location: Silver Spring Area, MD, USA
Re: Using the dict name coming from a string variable
Ah, dictionary symbols whose names are unknown until runtime. That was requested a long time ago and is one of the rare features I did not implemented in the fork.
The most recent features I implemented were:
a) Independent-level dictionaries, after extending dictionary support beyond three levels, up to 8 levels per dictionary. A level can be marked as independent, which makes each of its nodes a case of its own, with its own key and no parent node. The option lets two kinds of case share one dictionary and one data file, in an external dictionary or in the main dictionary of a batch or data entry application.
b) Wi-Fi Direct (Wi-Fi P2P) for direct data sharing between devices. The legacy Bluetooth is slow and very limited...in range...
Best,
The most recent features I implemented were:
a) Independent-level dictionaries, after extending dictionary support beyond three levels, up to 8 levels per dictionary. A level can be marked as independent, which makes each of its nodes a case of its own, with its own key and no parent node. The option lets two kinds of case share one dictionary and one data file, in an external dictionary or in the main dictionary of a batch or data entry application.
b) Wi-Fi Direct (Wi-Fi P2P) for direct data sharing between devices. The legacy Bluetooth is slow and very limited...in range...
Best,
You do not have the required permissions to view the files attached to this post.
G.VOLNY, a CSProuser from Haiti, since 2004