Home AMX User Forum NetLinx Studio

Create a resources file - two questions

All:

I've searched for an answers for these on the forum, but couldn't find them. If they're here can you point me to the topics?

Q1 - In other programming, many of the common items (strings, image files, layouts) are contained in a resources files. To assist my faculty, I'm working on a number of help popups or tool tips to be dynamically generated on the touch panel. However, I'd rather not have to open and re-compile source code simply to correct a spelling error, clean-up wording or similar correction. I'd simply like a resource file with my help strings that I can edit in notepad and have it called at runtime.

I thought the answer would be, as in php and others, to create an include file. I figured I could call it with #INCLUDE, but I can't seem to create a file that simply contains....
DEFINE_CONSTANT
ttMakeCall = 'Here's the tooltip that tells faculty how to place a call.'
ttConference = 'Here's the tooltip with hints about conferencing'
.
.
.

Do I need to add #IF_NOT_DEFINED for all my touch panels as part of the include?


Q2 - What would be the best way to add a CR/LF to a multi-line help file?
1. Here's step one. (CR/LF)
2. How about step two (CR/LF)
3. If you're here, you've gone too far.

TIA for all your help.

Comments

  • GregGGregG Posts: 251
    1) Since netlinx has to be compiled in order to pick up changes to include files, no variation of that method will work in your case. I'd recommend reading/writing a file on the master using the file_* functions, and the users can access that file using ftp. I wrote a module that loads xml files from the master's internal disk for dealing with large amounts of dynamic data. The main thing is that you will need a "reload" button somewhere in the admin pages on the panel so that it will pull the updated file without needing a reboot. I also usually include an in-panel editor to make changes from right on the touch panel. Pretty much any file load/save function you write can work for this kind of thing and it doesn't need to be as complex as full xml compliance.

    2) The send_command to update text on a touch panel will read the pipe character " | " as a CR/LF equivalent so a string like this: "one|word|per|line" will do what it says.

    FYI - If you are capturing user data from the touch panel keyboard and saving that out to a file, you might want to filter for CR/LF, since that will come back as part of the keyboard input, and translate it into " | " to put in the save file.
  • normschaefnormschaef Posts: 17
    Thanks, Greg. Your comment about using the various file functions sounds like similar to the solution I'm looking for. I'll give it a try. Thanks again.
Sign In or Register to comment.