Author Topic: Variables in text resources  (Read 2350 times)

0 Members and 1 Guest are viewing this topic.

Offline Robert Eric

Variables in text resources
« on: March 15, 2003, 08:58:59 PM »
Brian, how does one use variables such as strings or integers with text from text resources?  Is it something like

Print(108 3 temp)

where 108 is the text resource, 3 is the entry, and temp is the variable?  I haven't been able to find it in the help file or the tutorial and I haven't found out through experimenting yet.

Thanks



Offline Brian Provinciano

Re:Variables in text resources
« Reply #1 on: March 16, 2003, 01:21:55 AM »
You can do:
Print(108 3) to print the text entry #3 in text.108.
You can also do something like this:
Print(scriptNumber 3) to print text entry #3 in the current script's text (ie. script.001->text.001).

To do
Print(108 3 temp)
You need to do:
FormatPrint(108 3 temp)

The FormatPrint(108 3 temp) ability has been added in 3.01. Before, it only supported FormatPrint("something" temp).

You can also, of course, replace any normal string with the TEXT_NUM ENTRY_NUM combo. ie. StrCpy(@astring 123 245)

Offline Robert Eric

Re:Variables in text resources
« Reply #2 on: March 16, 2003, 05:32:09 PM »
I found that Format can also help.  Just Format(@aString 108 1 temp) then you can put the string in the Display kernal on the screen.  That way you can have like a screen in one room with a little countdown panel or something...

Offline Brian Provinciano

Re:Variables in text resources
« Reply #3 on: March 16, 2003, 06:13:59 PM »
Naturally. I used Format() in the FormatPrint routine.

Offline Robert Eric

Re:Variables in text resources
« Reply #4 on: March 16, 2003, 06:27:55 PM »
I said found.  When I was trying things out, I found that Format did the trick.  Then my discovery was clarified by you.  I found out how to do my little repeated mouse position check by accident too.  It's messy, and your next tutorial or information on the subject should help me fix things up and get a better view of just what I happened to do.


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.049 seconds with 21 queries.