Statements>Constant String
Introduction Installation Beginning Admin Quick Ref FTP Server SMTP Server Database Security
Statements Objects String Parsing Events Queues Samples Special names Error Handling Accessories   Back
Caravan Business Server>Help>Statements>Constant String
Syntax
<CARAVAN>
      Any string in quotes is a constant value.
</CARAVAN>
Text
Sample
<HTML>
<BODY>
<CARAVAN>
var x;
x(valA)="2.3" ;// 2.3 is a constant string
x(valB)="xyz" ;// xyz is a constant string
x(valC)="2"      ;// 2 is a constant string.

There is no distinction between a numeric value and a non numeric value. All strings are in quotes.

2 constant strings which are numeric can be added, subtracted, multiplied, divided or find the remainder (mode
operation).

e.g
1.
x(valA(01)) += x(valC) ;
x(valA)   ;// this will display 4.3

2.
x(valA(01)) -= x(valC) ;
x(valA)   ;// this will display 0.3

But 2 strings - one with a numeric value and another with string value can only be added (concatenated)

e.g
x(valA(01)) += x(valB) ;
x(valA)   ;// this will display "2.3xyz"

x(valA(01)) -= x(valC) ;// not valid

</CARAVAN>
</BODY>
</HTML>
Quick Reference
Home       Back