Post Reply 
"#pragma mode ..." statement
02-19-2019, 03:08 PM
Post: #1
"#pragma mode ..." statement
Hello

I have searched this forum and the old one about the "#pragma mode( separator(.,;) integer(h32) )" statement, but couldn't find the original thread which I seem to remember about this. Something warning us to add this line in order to avoid issues?
Context: I have lost quite a lot of time yesterday evening by trying to correct a so-called error at program check in a very short program copied from the User's Manual when I finally loaded it directly from the machine (as an example of use of a graphic function) and discovered this additional first line in the program, which is not in the PDF document...and makes all the difference!

I now try to understand what is lying behind this and would have been pleased to read about it in the history of the threads.

Many thanks advanced and kind regards.
Find all posts by this user
Quote this message in a reply
02-19-2019, 05:54 PM
Post: #2
RE: "#pragma mode ..." statement
I managed to write an article about that directive, but in my language: #pragma (Spanish)

Viga C | TD | FB
Visit this user's website Find all posts by this user
Quote this message in a reply
02-19-2019, 06:33 PM
Post: #3
RE: "#pragma mode ..." statement
The Prime will interpret symbols in a program according to the settings currently in force for displaying numbers etc.

For example, if your Home settings say that the number format to use to display numbers to you is with a dot as a thousands separator and a comma as a decimal separator, then the number '12345' will be displayed:

Code:
12.345

If you now have this in a program:

Code:
A := 12,345

it will be interpreted as the real number '12.345'

What the #pragma directive does is say to the Prime: "Right, if the number format to use isn't explicit in a literal that you see in this program, ignore your Home settings and use these settings instead."

With the appropriate #pragma setting, the "12,345" above will be interpreted as twelve thousand, three hundred and forty-five despite your home settings saying that the comma is the decimal separator rather than the thousands separator.

#pragma clears up ambiguities.
Find all posts by this user
Quote this message in a reply
02-19-2019, 08:44 PM
Post: #4
RE: "#pragma mode ..." statement
Hello Carlos and grsbanks

I thank you for your prompt replies. I will read them carefully and take the best of it.
Carlos, I hope that Google will translate your text good enough, because I don't speak more than a few words in Spanish. Muchas gracias!

Kind regards.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)