Language basics

Comments

Supported

  1. Common Comments

    • Double-slash method: Code // Comment

      A= B + C // Comment
    • Slash-and-asterisk method: /* Comment */

      A= /* comment */ B + C
  2. Embedded comments

    // Comment1 /* Comment2

    /* Comment1 // Comment2 */

    /* Comment1 /* Comment2 */ Comment3 */

    For example:

    A = B + C /* This comment starts here.
    /* This is the start of a nested comment. The nested comment ends here. */
    The first comment ends here.
    */ + D + E + F

Unsupported

Do not use the double-slash method to comment out scripts in the SQL statement for DataWindows.

Identifiers

Supported

Identifiers in PowerServer refer to global/instance/local variable names, or object names, or menu names & menu item names. Note that menu names & menu item names are regarded as identifiers.

Rules for identifiers:

  • Identifiers can be reserved words in JavaScript, apart from the identifier word "Object".

  • Can have up to 40 characters but no spaces.

  • Must start with a letter or an underscore ("_") and can include any combination of the letters, numbers and special characters listed in Appeon supported identifiers.

  • In the case of duplicate objects, objects earlier in the PBL list overwrite those later in the PBL list.

Unsupported

  • Objects of different types cannot have the same name.

  • Objects of the same type, even if they are in different PBLs, cannot have the same name.

  • Instance variable and function in the same object cannot have the same name.

  • The "Ω" will not be automatically converted to “ω” in Appeon.

  • Identifiers cannot be reserved words in PowerServer: appeondatawindow, appeondatastore, appeonservice, appeon_nvo_db_update, appeonextfuncs, appeonfileservice, ejbserial, ejbobject and parse_retval_object.

Appeon supported identifiers

Letters, numbers or special characters with Unicode listed below or within the intervals are supported.

  • All intervals are closed intervals.

  • Cannot start with the letter, number or special character corresponding to the Unicode (or within the intervals) marked with "*".

30-39 *

41-5A

5F

61-7A

B7 *

C0-D6

D8-F6

F8-131

134-13E

141-148

14A-17E

180-1C3

1CD-1F0

1F4-1F5

1FA-217

250-2A8

2BB-2C1 *

2D0-2D1 *

300-345 *

360-361 *

386

387*

388-38A

38C

38E-3A1

3A3-3CE

3D0-3D6

3DA

3DC

3DE

3E0

3E2-3F3

401-40C

40E-44F

451-45C

45E-481

483-486 *

490-4C4

4C7-4C8

4CB-4CC

4D0-4EB

4EE-4F5

4F8-4F9

531-556

559 *

561-586

591-5A1 *

5A3-5B9 *

5BB-5BD *

5BF *

5C1-5C2 *

5C4 *

5D0-5EA

5F0-5F2

621-63A

640 *

641-64A

64B-652 *

660-669 *

670 *

671-6B7

6BA-6BE

6C0-6CE

6D0-6D3

6D5

6D6-6E8 *

6EA-6ED *

6F0-6F9 *

901-903 *

905-939

93C-94D *

951-954 *

958-961

962-963 *

966-96F *

981-983 *

985-98C

98F-990

993-9A8

9AA-9B0

9B2

9B6-9B9

9BC *

9BE-9C4 *

9C7-9C8 *

9CB-9CD *

9D7 *

9DC-9DD

9DF-9E1

9E2-9E3 *

9E6-9EF *

9F0-9F1

A02 *

A05-A0A

A0F-A10

A13-A28

A2A-A30

A32-A33

A35-A36

A38-A39

A3C *

A3E-A42 *

A47-A48 *

A4B-A4D *

A59-A5C

A5E-A5E

A66-A74 *

A81-A83 *

A85-A8B

A8D

A8F-A91

A93-AA8

AAA-AB0

AB2-AB3

AB5-AB9

ABC-AC5 *

AC7-AC9 *

ACB-ACD *

AE0

AE6-AEF *

B01-B03 *

B05-B0C

B0F-B10

B13-B28

B2A-B30

B32-B33

B36-B39

B3C-B43 *

B47-B48 *

B4B-B4D *

B56-B57 *

B5C-B5D

B5F-B61

B66-B6F *

B82-B83 *

B85-B8A

B8E-B90

B92-B95

B99-B9A

B9C

B9E-B9F

BA3-BA4

BA8-BAA

BAE-BB5

BB7-BB9

BBE-BC2 *

BC6-BC8 *

BCA-BCD *

BD7 *

BE7-BEF *

C01-C03 *

C05-C0C

C0E-C10

C12-C28

C2A-C33

C35-C39

C3E-C44 *

C46-C48 *

C4A-C4D *

C55-C56 *

C60-C61

C66-C6F *

C82-C83 *

C85-C8C

C8E-C90

C92-CA8

CAA-CB3

CB5-CB9

CBE-CC4 *

CC6-CC8 *

CCA-CCD *

CD5-CD6 *

CDE

CE0-CE1

CE6-CEF *

D02-D03 *

D05-D0C

D0E-D10

D12-D28

D2A-D39

D3E-D43 *

D46-D48 *

D4A-D4D *

D57 *

D60-D61

D66-D6F *

E01-E2E

E30

E31 *

E32-E33

E34-E3A *

E40-E45

E46-E4E *

E50-E59 *

E81-E82

E84

E87-E88

E8A

E8D

E94-E97

E99-E9F

EA1-EA3

EA5

EA7

EAA-EAB

EAD-EAE

EB0-EB9 *

EBB-EBD *

EC0-EC4 *

EC6 *

EC8-ECD *

ED0-ED9 *

F18-F19 *

F20-F29 *

F35 *

F37 *

F39 *

F3E-F3F *

F40-F47

F49-F69

F71-F84 *

F86-F8B *

F90-F95 *

F97 *

F99-FAD *

FB1-FB7 *

FB9 *

10A0-10C5

10D0-10F6

1100

1102-1103

1105-1107

1109

110B-110C

110E-1112

113C

113E

1140

114C

114E

1150

1154-1155

1159

115F-1161

1163

1165

1167

1169

116D-116E

1172-1173

1175

119E

11A8

11AB

11AE-11AF

11B7-11B8

11BA

11BC-11C2

11EB

11F0

11F9

1E00-1E9B

1EA0-1EF9

1F00-1F15

1F18-1F1D

1F20-1F45

1F48-1F4D

1F50-1F57

1F59

1F5B

1F5D

1F5F-1F7D

1F80-1FB4

1FB6-1FBC

1FBE *

1FC2-1FC4

1FC6-1FCC

1FD0-1FD3

1FD6-1FDB

1FE0-1FEC

1FF2-1FF4

1FF6-1FFC

20D0-20DC *

20E1 *

2126 *

212A-212B *

212E *

2180-2182 *

3005 *

3007

3021-302F *

3031-3035 *

3041-3094

3099-309A *

309D-309E *

30A1-30FA

30FC-30FE

3105-312C

4E00-9FA5

AC00-D7A3


Labels

Labels and GOTO statements are unsupported.

Special ASCII characters

Supported

ASCII character

To Specify This

Enter This

Common ASCII characters

Newline

~n

Tab

~t

Carriage return

~r

In PowerServer, "~r" is considered a newline character.

Formfeed

~f

Backspace

~b

Double quote

~"

Single quote

~'

Tilde

~~

Any ASCII character

Hexadecimal

~h##

Octal

~o###


Unsupported

  1. In a Web application, a character whose ASCII value is greater than 127 cannot be saved to the database.

  2. In PowerBuilder, for characters whose ASCII value is greater than 128, the equal operator will consider them the same. However, in PowerServer, the equal operator will not consider them the same.

  3. Common ASCII character: Vertical tab (~v).

  4. Any ASCII character: Decimal (~###) Note: Appeon ignores the escape character ("~") specified in the PowerBuilder painter. In SQL statements, "~" is handled as escape character.

  5. Tilde ("~") on the web may not take effect if it is contained in a nested string that is a variable or it is contained in a string whose nested level is up to two.

Null values

Supported

NULL means undefined or unknown. It is not the same as an empty string, a zero, or a date of 0000-00-00. For example, NULL is neither 0 nor "" (empty string).

Null in PowerBuilder is directly translated into Null in JavaScript.

Unsupported

Expressions involving Null values may arrive at different values in JavaScript from their values in PowerScript. For example, the expression A + B in PowerScript will return Null if any of A or B is Null. However, in JavaScript, the expression will not return Null even if A or B is Null. In addition, an arithmetic or relational operation involving a null value always returns null in PowerBuilder. As shown in the following table, the return value is not always null in JavaScript:

Operation

Return Value

Assuming SetNull(A), SetNull(B)

PowerBuilder

JavaScript

Arithmetic

A+1

Null

1

A+B

Null

0

A*B

Null

0

Relational

A=1

Null

False

A<>1

Null

True

NOT (A=1)

Null

True

A=A

Null

True

A=B

Null

True

IsNull(A=1)

True

False

String concatenation

A+"ABC"

Null

"NULLABC"

A+B

Null

"NULLNULL"


Reserved words

Supported Reserved Words

and

call

case

catch

choose

close

commit

connect

constant

continue

create

cursor

declare

delete

describe

disconnect

do

dynamic

else

elseif

end

event

execute

exit

false

fetch

first

for

forward

from

function

global

halt

if

immediate

insert

into

is

last

loop

next

not

of

on

open

or

parent

post

prior

prepare

ref

return

rollback

rpcfunc

select

step

subroutine

super

then

this

to

trigger

true

try

type

until

update

using

while

with

within

selectblob

updateblob

             

  • The reserved word HALT is supported, but the code after the Halt statement will not be executed in PowerServer Mobile.

  • PROCEDURE can only be used in the DECLARE Procedure SQL statement.

Unsupported Reserved Words

enumerated

external

finally

goto

indirect

intrinsic

library

system

systemread

systemwrite

throw

throws

Eon

EonApp

EonObject

EonStatic

EonMenu

PB

PBGlobal

PBArray

       

Pronouns

Supported

The following pronouns in PowerScript are supported:

  • Parent - refers to the object that contains the current object.

    Using Parent in the script for a visual user object is supported.

  • This - refers to the window, user object, menu, application object, or control that owns the current script.

  • Super - refer to the immediate ancestor for a descendant object or control.

Unsupported

None.

Statement continuation & separation

Supported

  • The statement continuation character (&) and syntax are supported. The syntax is as follows:

    Start of statement &
       more statement &
    end of statement
    
  • The statement separation character (;) and syntax are supported. The syntax is as follows:

    Statement1; statement2

Note: White Space (Blanks, tabs, formfeeds, and comments) in the statement is supported and treated the same way as in PowerBuilder.

Unsupported

None.