Normal Topic When Sesame uses @? (Read 870 times)
Rick_R
Full Member
***
Offline



Posts: 243
Joined: Jan 29th, 2010
When Sesame uses @?
Mar 2nd, 2011 at 9:18pm
Print Post Print Post  
Is there any particular pattern as to when a Sesame function, etc., will begin with @ and when not? I note that when there is both a command that sets something and a function that returns the value--e.g., ClientLocalValue() and @ClientLocalValue()--the one that returns the value will have an @.  But other times it seems random, e.g., @Right, @Left but ToLower and ToUpper.

(Or is it like a Quiz Discover Magazine had years ago where they asked the relationship among a bunch of seemingly random numbers?  People sent in all sorts of complex formulas that purportedly generated the set.  The correct answer was that they were the Express stops for a particular New York City subway line!)
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: When Sesame uses @?
Reply #1 - Mar 2nd, 2011 at 9:32pm
Print Post Print Post  
I cannot give you the precise answer like a Lantican can, (I am sure they will eventually chime in)  but I would think a bunch of the conventions were forced upon them from the way Q&A was written. Remember lots of the commands in Sesame were created as carryovers to be comfortable (and compatible) to us older Q&A junkies.

I am sure the Lanticans have standardized on a convention they like however the older Q&A commands may or may not always fall within their chosen criteria.

Well at least this is my thoughts on the subject.
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Rick_R
Full Member
***
Offline



Posts: 243
Joined: Jan 29th, 2010
Re: When Sesame uses @?
Reply #2 - Mar 2nd, 2011 at 11:20pm
Print Post Print Post  
I hadn't thought about it from a QA vs. Sesame perspective. That makes a lot of sense.  (I'm a newbie with Sesame and never worked with QA programming and I am constantly adding @ to ToUpper and forgetting to put it with @Left and @Right.)
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: When Sesame uses @?
Reply #3 - Mar 2nd, 2011 at 11:51pm
Print Post Print Post  
Rick_R wrote on Mar 2nd, 2011 at 11:20pm:
(I'm a newbie with Sesame and never worked with QA programming and I am constantly adding @ to ToUpper and forgetting to put it with @Left and @Right.)



Rick,
I wish I had a good excuse like your being new to Sesame, I mis-type and or mangle commands constantly. My only excuse is stupidity and old age.

I am just lucky Sesame has the magic test button in the programming editor that points out my mistakes and quickly gets me back on track!
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: When Sesame uses @?
Reply #4 - Mar 3rd, 2011 at 2:32pm
Print Post Print Post  
Bob is essentially correct, we inherited some conventions and inconsistencies from Q&A. We also developed a couple of our very own. In general, functions use the leading "@" and subroutines do not. In any case, here is a quick list of the exceptions (derived by a glance, so there may be a couple of misses):

Subroutines having a "@":
=================
@msg( s as string )
@ditto( var ... as string )
@help( var fieldName as string )
@play( ... as string )
@color( var fieldName as string, textColor as int, backgrColor as int )
@save()
@exit()
@fedit()
@macro( mname as string )
@deferredmacro( mname as string )
@msgBox( x as string, y as string, z as string )

Functions without a "@":
================
readchar() as char
fileOpen( fileName as string ) as int
fileSize( handle as int ) as int
filePos( handle as int ) as int
fileReadChar( handle as int ) as char
fileGetLastError() as int
fileGetErrorMsg( errorCode as int ) as string
fileExists( fileName as string ) as boolean
dims( var a as array ) as int
dimLimit( n as int, var a as array ) as int
elementType( var a as array ) as string
intElement( var a as array, ... as int ) as int
doubleElement( var a as array, ... as int ) as double
moneyElement( var a as array, ... as int ) as money
booleanElement( var a as array, ... as int ) as boolean
charElement( var a as array, ... as int ) as char
dateElement( var a as array, ... as int ) as date
timeElement( var a as array, ... as int ) as time
stringElement( var a as array, ... as int ) as string
tab( n as int ) as string
split( var s as string, delimiters as string ) as string
random( n as double ) as double
toUpper( s as string ) as string
toLower( s as string ) as string

The "test" command is a real life-saver, as is the List Browser.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Rick_R
Full Member
***
Offline



Posts: 243
Joined: Jan 29th, 2010
Re: When Sesame uses @?
Reply #5 - Mar 3rd, 2011 at 7:28pm
Print Post Print Post  
Actually, looking at the functions that don't begin with @, many of them are found almost exactly the same in many programming languages (e.g., TAB()).  It would be more of a pain to have to remember that in SBASIC only FilePos, FileExists, FileReadChar, etc., require an @.
  
Back to top
 
IP Logged