G:/ScriptBasic/source/commands/let.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <math.h>
#include "../command.h"

Go to the source code of this file.

Functions

long * RaiseError (pExecuteObject pEo)
 DEREFERENCE (LetThisVariable)
 if (ExpressionResult==NULL||TYPE(ExpressionResult)!=VTYPE_ARRAY)
 if (memory_ReplaceVariable(pEo-> ArrayCopyTo==NULL)
 if (iError)
 while (nItem)
 if (memory_Type(*LetThisVariable)==VTYPE_DOUBLE)
 if (bResultIsBig||(memory_Type(Op1)==VTYPE_DOUBLE||memory_Type(Op2)==VTYPE_DOUBLE)||(memory_Type(Op1)==VTYPE_STRING &&!ISSTRINGINTEGER(Op1))||(memory_Type(Op2)==VTYPE_STRING &&!ISSTRINGINTEGER(Op2)))
 if ((memory_Type(Op1)==VTYPE_DOUBLE||memory_Type(Op2)==VTYPE_DOUBLE)||(memory_Type(Op1)==VTYPE_STRING &&!ISSTRINGINTEGER(Op1))||(memory_Type(Op2)==VTYPE_STRING &&!ISSTRINGINTEGER(Op2)))
 if (STRLEN(Op2)==0)
if LetThisVariable memory_ReleaseVariable (pEo->pMo,*LetThisVariable)

Variables

VARIABLE ExpressionResult
VARIABLE ArrayCopyTo
LEFTVALUE LetThisVariable
long refcount
 LetThisVariable = EVALUATELEFTVALUE(PARAMETERNODE)
 ASSERTOKE
 NEXTPARAMETER
 ExpressionResult = execute_Evaluate(pEo,PARAMETERNODE,_pThisCommandMortals,&iErrorCode,1)
 ASSERTOKE
 ArrayCopyTo = memory_CopyArray(pEo->pMo,ExpressionResult)
v1 = NewValue
 iError = memory_SetRef(pEo->pMo,v1,v2)
END NODE nItem
LEFTVALUE LetThisVariable
VARIABLE NewValue
unsigned long refcount
 nItem = PARAMETERNODE
END VARIABLE ExpressionResult
VARIABLE Op1
VARIABLE Op2
LEFTVALUE LetThisVariable
long refcount
int bResultIsBig
long Lop2
double dResult
long lResult
 LetThisVariable = EVALUATELEFTVALUE(PARAMETERNODE)
 ASSERTOKE
 NEXTPARAMETER
 Op2 = execute_Evaluate(pEo,PARAMETERNODE,_pThisCommandMortals,&iErrorCode,0)
 ASSERTOKE
 bResultIsBig = 0
 Op1 = *LetThisVariable
LetThisVariable = ExpressionResult
END VARIABLE ExpressionResult
VARIABLE Op1
VARIABLE Op2
LEFTVALUE LetThisVariable
long refcount
int bResultIsBig
long Lop2
double dResult
long lResult
 LetThisVariable = EVALUATELEFTVALUE(PARAMETERNODE)
 ASSERTOKE
 NEXTPARAMETER
 Op2 = execute_Evaluate(pEo,PARAMETERNODE,_pThisCommandMortals,&iErrorCode,0)
 ASSERTOKE
 bResultIsBig = 0
 Op1 = *LetThisVariable
LetThisVariable = ExpressionResult
END VARIABLE ExpressionResult
VARIABLE Op1
VARIABLE Op2
LEFTVALUE LetThisVariable
long refcount
int bResultIsBig
long Lop2
double dResult
long lResult
 LetThisVariable = EVALUATELEFTVALUE(PARAMETERNODE)
 ASSERTOKE
 NEXTPARAMETER
 Op2 = execute_Evaluate(pEo,PARAMETERNODE,_pThisCommandMortals,&iErrorCode,0)
 ASSERTOKE
 bResultIsBig = 0
 Op1 = *LetThisVariable
LetThisVariable = ExpressionResult
END VARIABLE ExpressionResult
VARIABLE Op1
VARIABLE Op2
LEFTVALUE LetThisVariable
long refcount
long lop2
double dResult
long lResult
 LetThisVariable = EVALUATELEFTVALUE(PARAMETERNODE)
 ASSERTOKE
 NEXTPARAMETER
 Op2 = execute_Evaluate(pEo,PARAMETERNODE,_pThisCommandMortals,&iErrorCode,0)
 ASSERTOKE
 Op1 = *LetThisVariable
LetThisVariable = ExpressionResult
END VARIABLE ExpressionResult
VARIABLE Op1
VARIABLE Op2
LEFTVALUE LetThisVariable
long refcount
double dResult
long lResult
 LetThisVariable = EVALUATELEFTVALUE(PARAMETERNODE)
 ASSERTOKE
 NEXTPARAMETER
 Op2 = execute_Evaluate(pEo,PARAMETERNODE,_pThisCommandMortals,&iErrorCode,0)
 ASSERTOKE
 Op1 = *LetThisVariable
LetThisVariable = ExpressionResult
END VARIABLE ExpressionResult
VARIABLE Op1
VARIABLE Op2
LEFTVALUE LetThisVariable
long refcount
 LetThisVariable = EVALUATELEFTVALUE(PARAMETERNODE)
 ASSERTOKE
 NEXTPARAMETER
 Op2 = execute_Evaluate(pEo,PARAMETERNODE,_pThisCommandMortals,&iErrorCode,0)
 ASSERTOKE
 Op1 = *LetThisVariable
 Op1 = CONVERT2STRING(Op1)
 Op2 = CONVERT2STRING(Op2)
LetThisVariable = ExpressionResult


Function Documentation

DEREFERENCE LetThisVariable   ) 
 

if STRLEN(Op2 = = 0  ) 
 

Definition at line 975 of file let.c.

if (memory_Type(Op1)==VTYPE_DOUBLE||memory_Type(Op2)==VTYPE_DOUBLE)||(memory_Type(Op1)==VTYPE_STRING &&!ISSTRINGINTEGER(Op1))||(memory_Type(Op2)==VTYPE_STRING &&!ISSTRINGINTEGER(Op2))   ) 
 

Definition at line 777 of file let.c.

References ERROR(), NULL, pEo, and RaiseError().

if bResultIsBig||  (memory_Type(Op1)==VTYPE_DOUBLE||memory_Type(Op2)==VTYPE_DOUBLE)||(memory_Type(Op1)==VTYPE_STRING &&!ISSTRINGINTEGER(Op1))||(memory_Type(Op2)==VTYPE_STRING &&!ISSTRINGINTEGER(Op2))  ) 
 

Definition at line 406 of file let.c.

References LONGVALUE().

if memory_Type *  LetThisVariable = = VTYPE_DOUBLE  ) 
 

Definition at line 370 of file let.c.

References LONGVALUE(), memory_ReleaseVariable(), pEo, and RETURN.

if iError   ) 
 

Definition at line 188 of file let.c.

if memory_ReplaceVariable(pEo->  ArrayCopyTo = NULL  ) 
 

Definition at line 82 of file let.c.

if ExpressionResult  = NULL || TYPE(ExpressionResult) != VTYPE_ARRAY  ) 
 

Definition at line 74 of file let.c.

References memory_ReplaceVariable(), pEo, and RETURN.

if LetThisVariable memory_ReleaseVariable pEo->  pMo,
LetThisVariable
 

long* RaiseError pExecuteObject  pEo  ) 
 

Definition at line 85 of file mathops.c.

Referenced by if().

while nItem   ) 
 

Definition at line 301 of file let.c.

References ASSERTOKE, ERROR(), memory_DupImmortal(), memory_ReleaseVariable(), NULL, and pEo.


Variable Documentation

ArrayCopyTo = memory_CopyArray(pEo->pMo,ExpressionResult)
 

Definition at line 81 of file let.c.

VARIABLE ArrayCopyTo
 

Definition at line 53 of file let.c.

ASSERTOKE
 

Definition at line 968 of file let.c.

ASSERTOKE
 

Definition at line 956 of file let.c.

ASSERTOKE
 

Definition at line 871 of file let.c.

ASSERTOKE
 

Definition at line 859 of file let.c.

ASSERTOKE
 

Definition at line 724 of file let.c.

ASSERTOKE
 

Definition at line 712 of file let.c.

ASSERTOKE
 

Definition at line 603 of file let.c.

ASSERTOKE
 

Definition at line 591 of file let.c.

ASSERTOKE
 

Definition at line 486 of file let.c.

ASSERTOKE
 

Definition at line 474 of file let.c.

ASSERTOKE
 

Definition at line 368 of file let.c.

ASSERTOKE
 

Definition at line 356 of file let.c.

ASSERTOKE
 

Definition at line 71 of file let.c.

ASSERTOKE
 

Definition at line 59 of file let.c.

bResultIsBig = 0
 

Definition at line 626 of file let.c.

int bResultIsBig
 

Definition at line 584 of file let.c.

bResultIsBig = 0
 

Definition at line 505 of file let.c.

int bResultIsBig
 

Definition at line 467 of file let.c.

bResultIsBig = 0
 

Definition at line 387 of file let.c.

int bResultIsBig
 

Definition at line 349 of file let.c.

double dResult
 

Definition at line 854 of file let.c.

double dResult
 

Definition at line 707 of file let.c.

double dResult
 

Definition at line 586 of file let.c.

double dResult
 

Definition at line 469 of file let.c.

double dResult
 

Definition at line 351 of file let.c.

END VARIABLE ExpressionResult
 

LETC =section misc =title v &= expression =display LETC

Append a string to a variable.

The variable can be a global or local variable, array element or associative array element.

You can use this command as a shorthand for T<v = v & expression>. Using this short format is more readable in some cases and generates more efficient code. However note that this kind of assignment operation is a C language like operator and is not common in BASIC programs.

Definition at line 949 of file let.c.

END VARIABLE ExpressionResult
 

LETI =section misc =title v \= expression =display LETI

Integer divide a variable by a value.

The variable can be a global or local variable, array element or associative array element.

You can use this command as a shorthand for T<v = v \ expression>. Using this short format is more readable in some cases and generates more efficient code. However note that this kind of assignment operation is a C language like operator and is not common in BASIC programs.

Definition at line 850 of file let.c.

END VARIABLE ExpressionResult
 

LETD =section misc =title v /= expression =display LETD

Divide a variable by an expression.

The variable can be a global or local variable, array element or associative array element.

You can use this command as a shorthand for T<v = v / expression>. Using this short format is more readable in some cases and generates more efficient code. However note that this kind of assignment operation is a C language like operator and is not common in BASIC programs.

Definition at line 702 of file let.c.

END VARIABLE ExpressionResult
 

LETS =section misc =title v *= expression =display LETS

Multiply a variable with a value.

The variable can be a global or local variable, array element or associative array element.

You can use this command as a shorthand for T<v = v * expression>. Using this short format is more readable in some cases and generates more efficient code. However note that this kind of assignment operation is a C language like operator and is not common in BASIC programs.

Definition at line 580 of file let.c.

END VARIABLE ExpressionResult
 

LETP =section misc =title v += expression =display LETP

Add a value to a variable.

The variable can be a global or local variable, array element or associative array element.

You can use this command as a shorthand for T<v = v + expression>. Using this short format is more readable in some cases and generates more efficient code. However note that this kind of assignment operation is a C language like operator and is not common in BASIC programs.

Definition at line 463 of file let.c.

END VARIABLE ExpressionResult
 

LETM =section misc =title v -= expression =display LETM

This command subtracts a value from a variable.

The variable can be a global or local variable, array element or associative array element.

You can use this command as a shorthand for T<v = v - expression>. Using this short format is more readable in some cases and generates more efficient code. However note that this kind of assignment operation is a C language like operator and is not common in BASIC programs.

Definition at line 345 of file let.c.

ExpressionResult = execute_Evaluate(pEo,PARAMETERNODE,_pThisCommandMortals,&iErrorCode,1)
 

Definition at line 70 of file let.c.

VARIABLE ExpressionResult
 

LET =section misc =title v = expression =display LET

Assign a value to a variable.

On the left side of the T<=> a variable or some other ScriptBasic left value has to stand. On the right side an expression should be used. First the left value is evaluated and then the expression. Finally the left value's old value is replaced by the result of the expression.

The left value standing on the left side of the T<=> can be a local or global variable, array element or associative array element.

Definition at line 53 of file let.c.

iError = memory_SetRef(pEo->pMo,v1,v2)
 

Definition at line 186 of file let.c.

* LetThisVariable = ExpressionResult
 

Definition at line 992 of file let.c.

LetThisVariable = EVALUATELEFTVALUE(PARAMETERNODE)
 

Definition at line 955 of file let.c.

LEFTVALUE LetThisVariable
 

Definition at line 951 of file let.c.

* LetThisVariable = ExpressionResult
 

Definition at line 929 of file let.c.

LetThisVariable = EVALUATELEFTVALUE(PARAMETERNODE)
 

Definition at line 858 of file let.c.

LEFTVALUE LetThisVariable
 

Definition at line 852 of file let.c.

* LetThisVariable = ExpressionResult
 

Definition at line 828 of file let.c.

LetThisVariable = EVALUATELEFTVALUE(PARAMETERNODE)
 

Definition at line 711 of file let.c.

LEFTVALUE LetThisVariable
 

Definition at line 704 of file let.c.

* LetThisVariable = ExpressionResult
 

Definition at line 682 of file let.c.

LetThisVariable = EVALUATELEFTVALUE(PARAMETERNODE)
 

Definition at line 590 of file let.c.

LEFTVALUE LetThisVariable
 

Definition at line 582 of file let.c.

* LetThisVariable = ExpressionResult
 

Definition at line 560 of file let.c.

LetThisVariable = EVALUATELEFTVALUE(PARAMETERNODE)
 

Definition at line 473 of file let.c.

LEFTVALUE LetThisVariable
 

Definition at line 465 of file let.c.

* LetThisVariable = ExpressionResult
 

Definition at line 443 of file let.c.

LetThisVariable = EVALUATELEFTVALUE(PARAMETERNODE)
 

Definition at line 355 of file let.c.

LEFTVALUE LetThisVariable
 

Definition at line 347 of file let.c.

LEFTVALUE LetThisVariable
 

Definition at line 296 of file let.c.

LetThisVariable = EVALUATELEFTVALUE(PARAMETERNODE)
 

Definition at line 58 of file let.c.

LEFTVALUE LetThisVariable
 

Definition at line 54 of file let.c.

long lop2
 

Definition at line 706 of file let.c.

long Lop2
 

Definition at line 585 of file let.c.

long Lop2
 

Definition at line 468 of file let.c.

long Lop2
 

Definition at line 350 of file let.c.

long lResult
 

Definition at line 855 of file let.c.

long lResult
 

Definition at line 708 of file let.c.

long lResult
 

Definition at line 587 of file let.c.

long lResult
 

Definition at line 470 of file let.c.

long lResult
 

Definition at line 352 of file let.c.

VARIABLE NewValue
 

Definition at line 297 of file let.c.

NEXTPARAMETER
 

Definition at line 963 of file let.c.

NEXTPARAMETER
 

Definition at line 866 of file let.c.

NEXTPARAMETER
 

Definition at line 719 of file let.c.

NEXTPARAMETER
 

Definition at line 598 of file let.c.

NEXTPARAMETER
 

Definition at line 481 of file let.c.

NEXTPARAMETER
 

Definition at line 363 of file let.c.

NEXTPARAMETER
 

Definition at line 66 of file let.c.

nItem = PARAMETERNODE
 

Definition at line 300 of file let.c.

END NODE nItem
 

Definition at line 295 of file let.c.

Op1 = CONVERT2STRING(Op1)
 

Definition at line 972 of file let.c.

Op1 = *LetThisVariable
 

Definition at line 970 of file let.c.

VARIABLE Op1
 

Definition at line 950 of file let.c.

Op1 = *LetThisVariable
 

Definition at line 873 of file let.c.

VARIABLE Op1
 

Definition at line 851 of file let.c.

Op1 = *LetThisVariable
 

Definition at line 774 of file let.c.

VARIABLE Op1
 

Definition at line 703 of file let.c.

Op1 = *LetThisVariable
 

Definition at line 642 of file let.c.

VARIABLE Op1
 

Definition at line 581 of file let.c.

Op1 = *LetThisVariable
 

Definition at line 520 of file let.c.

VARIABLE Op1
 

Definition at line 464 of file let.c.

Op1 = *LetThisVariable
 

Definition at line 403 of file let.c.

VARIABLE Op1
 

Definition at line 346 of file let.c.

Op2 = CONVERT2STRING(Op2)
 

Definition at line 973 of file let.c.

Op2 = execute_Evaluate(pEo,PARAMETERNODE,_pThisCommandMortals,&iErrorCode,0)
 

Definition at line 967 of file let.c.

VARIABLE Op2
 

Definition at line 950 of file let.c.

Op2 = execute_Evaluate(pEo,PARAMETERNODE,_pThisCommandMortals,&iErrorCode,0)
 

Definition at line 870 of file let.c.

VARIABLE Op2
 

Definition at line 851 of file let.c.

Op2 = execute_Evaluate(pEo,PARAMETERNODE,_pThisCommandMortals,&iErrorCode,0)
 

Definition at line 723 of file let.c.

VARIABLE Op2
 

Definition at line 703 of file let.c.

Op2 = execute_Evaluate(pEo,PARAMETERNODE,_pThisCommandMortals,&iErrorCode,0)
 

Definition at line 602 of file let.c.

VARIABLE Op2
 

Definition at line 581 of file let.c.

Op2 = execute_Evaluate(pEo,PARAMETERNODE,_pThisCommandMortals,&iErrorCode,0)
 

Definition at line 485 of file let.c.

VARIABLE Op2
 

Definition at line 464 of file let.c.

Op2 = execute_Evaluate(pEo,PARAMETERNODE,_pThisCommandMortals,&iErrorCode,0)
 

Definition at line 367 of file let.c.

VARIABLE Op2
 

Definition at line 346 of file let.c.

long refcount
 

Definition at line 952 of file let.c.

long refcount
 

Definition at line 853 of file let.c.

long refcount
 

Definition at line 705 of file let.c.

long refcount
 

Definition at line 583 of file let.c.

long refcount
 

Definition at line 466 of file let.c.

long refcount
 

Definition at line 348 of file let.c.

unsigned long refcount
 

Definition at line 298 of file let.c.

long refcount
 

Definition at line 55 of file let.c.

* v1 = NewValue
 

Definition at line 184 of file let.c.


Generated on Sun Mar 12 23:56:33 2006 for ScriptBasic by  doxygen 1.4.6-NO