Quantcast
Channel: LiveCode Forums
Viewing all articles
Browse latest Browse all 669

LiveCode Builder • Re: Reading Characters from a string

$
0
0
(I'm assuming you are on mac)

Ignore extra "\" on the strings with "."

The expected result for your handler would be:
"Library version 1\.14\.58-7 on OS : mac"

(Taken from the Dictionary)
Returns a string describing the operating system that LiveCode is running on. The possible values are:
"windows" - 32-bit and 64-bit Windows
"mac" - Desktop OS X
"ios" - iOS (iPhone and iPad)
"android" - Android Linux devices
"linux" - All other Linux platforms
If you are getting a result different from the above could you specify Engine version and OS?

CODE:

public handler calLibraryVersion() returns Stringvariable tOsSystem as Stringvariable tTest as String/* If running on macOS you are putting "mac" inside tOsSystem */put the operating system into tOsSystem/* You could also directly do here:   *   put char 1 to 3 of tOsSystem into tTest  */get char 1 to 3 of tOsSystemput the result into tTest/* You could also directly do like:  *  return "Library version 1\.14\.58-7 on OS : " & char 1 to 3 of tOsSystem  */return "Library version 1\.14\.58-7 on OS : " & tTestend handler
A simplified version of the handler could be:

CODE:

public handler calLibraryVersion() returns Stringreturn "Library version 1\.14\.58-7 on OS : " & char 1 to 3 of the operating systemend handler
PD: ignore extra "\" on the string "Library version 1\.14\.58-7 on OS : "

Statistics: Posted by lcwill — Sat Jul 13, 2024 4:04 pm



Viewing all articles
Browse latest Browse all 669

Trending Articles