CSPro Syntax Wall Cards skip to AGE skip

  • Slides: 69
Download presentation
CSPro Syntax Wall Cards

CSPro Syntax Wall Cards

skip to AGE; skip to next;

skip to AGE; skip to next;

if then else if AGE < 5 then skip to UNDER_FIVE; else skip to

if then else if AGE < 5 then skip to UNDER_FIVE; else skip to FIVE_AND_OVER; endif;

comparison = Equal <> Not equal < Less than > Greater than <= Less

comparison = Equal <> Not equal < Less than > Greater than <= Less than or equal >= Greater than or equal in In range (AGE in 10: 15)

comments // Rest of line comment {Multi-line comment}

comments // Rest of line comment {Multi-line comment}

ask if AGE > 3;

ask if AGE > 3;

logical operators and (both true) or (either true) not (not true->false, not false->true)

logical operators and (both true) or (either true) not (not true->false, not false->true)

curocc(); curocc(ADULTS 000);

curocc(); curocc(ADULTS 000);

noinput;

noinput;

endgroup;

endgroup;

endlevel;

endlevel;

pos p = pos(“A”, “APPLE”);

pos p = pos(“A”, “APPLE”);

errmsg(“Hello”); errmsg(“Age is %d”, AGE); errmsg(“Name is %s”, NAME); %d Display number as integer

errmsg(“Hello”); errmsg(“Age is %d”, AGE); errmsg(“Name is %s”, NAME); %d Display number as integer %f Display number with decimal %s Display text string

reenter; reenter AGE;

reenter; reenter AGE;

strip s = strip(NAME);

strip s = strip(NAME);

getlabel s = getlabel(SEX_VS 1, SEX); s = getlabel(SEX_VS 1, 1);

getlabel s = getlabel(SEX_VS 1, SEX); s = getlabel(SEX_VS 1, 1);

errmsg with select errmsg(“Mother too young”) select(“Fix age”, AGE, “Fix relationship”, RELATIONSHIP);

errmsg with select errmsg(“Mother too young”) select(“Fix age”, AGE, “Fix relationship”, RELATIONSHIP);

warning(“Mother too young”) select(“Fix age”, AGE, “Fix relationship”, RELATIONSHIP, “Ignore”, continue);

warning(“Mother too young”) select(“Fix age”, AGE, “Fix relationship”, RELATIONSHIP, “Ignore”, continue);

Arithmetic + * / % ^ Addition Subtraction Multiplication Division Remainder Exponentiation

Arithmetic + * / % ^ Addition Subtraction Multiplication Division Remainder Exponentiation

datediff dd = datediff(DATE_OF_BIRTH, DATE_OF_INTERVIEW);

datediff dd = datediff(DATE_OF_BIRTH, DATE_OF_INTERVIEW);

variables numeric number. Of. Kids; alpha[30] name. Of. Mother; string name. Of. Mother;

variables numeric number. Of. Kids; alpha[30] name. Of. Mother; string name. Of. Mother;

Subscripts SEX(1) AGE(3) SEX(CHILD_MOTHER)

Subscripts SEX(1) AGE(3) SEX(CHILD_MOTHER)

special values notappl (blank/skipped) missing (9, 999…) default (read error)

special values notappl (blank/skipped) missing (9, 999…) default (read error)

totocc(ADULTS 000);

totocc(ADULTS 000);

setocclabel(PERSON(i), NAME(i));

setocclabel(PERSON(i), NAME(i));

do loop do i=1 while i < 10 if AGE(i) < 5 then under

do loop do i=1 while i < 10 if AGE(i) < 5 then under 5 s = under 5 s + 1; endif; enddo;

count num. Adults = count(ADULTS); under 5 s = count(ADULTS where AGE < 5);

count num. Adults = count(ADULTS); under 5 s = count(ADULTS where AGE < 5);

seek index. Head = seek(RELATIONSHIP = 1);

seek index. Head = seek(RELATIONSHIP = 1);

tr s = tr(“Message to translate”);

tr s = tr(“Message to translate”);

maketext msg = maketext( “%s is %d years old”, NAME, AGE);

maketext msg = maketext( “%s is %d years old”, NAME, AGE);

setcaselabel(MYDICT, “my case label”);

setcaselabel(MYDICT, “my case label”);

setvalueset(RELATIONSHIP, RELATIONSHIP_MALE); setvalueset(RELATIONSHIP, codes, labels);

setvalueset(RELATIONSHIP, RELATIONSHIP_MALE); setvalueset(RELATIONSHIP, codes, labels);

array mynumbers(10); array string mystrings(50); array mymatrix(5, 5);

array mynumbers(10); array string mystrings(50); array mymatrix(5, 5);

length n = length(NAME);

length n = length(NAME);

getocclabel(PERSON(i));

getocclabel(PERSON(i));

loadcase found = loadcase(VILLAGE_DICT, PROV, DIST);

loadcase found = loadcase(VILLAGE_DICT, PROV, DIST);

forcase DISTICT_DICT do codes(next. Entry) = DISTRICT_CODE; labels(next. Entry) = DISTRICT_NAME; next. Entry =

forcase DISTICT_DICT do codes(next. Entry) = DISTRICT_CODE; labels(next. Entry) = DISTRICT_NAME; next. Entry = next. Entry + 1; endfor;

user functions function is. Under 5(index) is. Under 5 = AGE(index) < 5; end;

user functions function is. Under 5(index) is. Under 5 = AGE(index) < 5; end;

userbar(clear); userbar(show); id = userbar(add button, “Go”, go); userbar(remove, id);

userbar(clear); userbar(show); id = userbar(add button, “Go”, go); userbar(remove, id);

accept choice = accept(“Finished? ”, “Yes”, “No”);

accept choice = accept(“Finished? ”, “Yes”, “No”);

advance to AGE;

advance to AGE;

move to AGE; move to AGE advance;

move to AGE; move to AGE advance;

showarray string people. Array(30, 3); showarray(people. Array, title(“Name”, “Age”, “Sex”));

showarray string people. Array(30, 3); showarray(people. Array, title(“Name”, “Age”, “Sex”));

visualvalue a = visualvalue(AGE);

visualvalue a = visualvalue(AGE);

systime t = systime(“HHMM”);

systime t = systime(“HHMM”);

sysdate d = sysdate(“YYYYMMDD”);

sysdate d = sysdate(“YYYYMMDD”);

setproperty(END_TIME, "Can. Enter. Not. Appl", "No. Confirm"); setproperty(PROVINCE, "Protected", "Yes");

setproperty(END_TIME, "Can. Enter. Not. Appl", "No. Confirm"); setproperty(PROVINCE, "Protected", "Yes");

timestamp t = timestamp();

timestamp t = timestamp();

execsystem (Windows) execsystem(“calc. exe”); execsystem( “explorer. exe myreport. html”, maximized, wait);

execsystem (Windows) execsystem(“calc. exe”); execsystem( “explorer. exe myreport. html”, maximized, wait);

execsystem (Android) execsystem( “app: com. google. android. gm”); execsystem( “view: myphoto. jpg”); execsystem( “camera:

execsystem (Android) execsystem( “app: com. google. android. gm”); execsystem( “view: myphoto. jpg”); execsystem( “camera: myphoto. jpg”);

getos if getos() in 20 then errmsg(“Android”); endif; if getos() in 10 then errmsg(“Windows”);

getos if getos() in 20 then errmsg(“Android”); endif; if getos() in 10 then errmsg(“Windows”); endif;

pathname s = pathname(Application); s = pathname(Temp); s = pathname(CSEntry);

pathname s = pathname(Application); s = pathname(Temp); s = pathname(CSEntry);

filedelete(“myfile. dat”);

filedelete(“myfile. dat”);

fileexist if fileexist(“myfile. dat”) then … endif;

fileexist if fileexist(“myfile. dat”) then … endif;

gps gps(open); gps(read, 60, 10); gps(latitude); gps(longitude);

gps gps(open); gps(read, 60, 10); gps(latitude); gps(longitude);

setfile tempfile; setfile(tempfile, “myfile. dat”);

setfile tempfile; setfile(tempfile, “myfile. dat”);

filewrite file tempfile; filewrite(tempfile, “hello”); filewrite(tempfile, “hello %s”, NAME);

filewrite file tempfile; filewrite(tempfile, “hello”); filewrite(tempfile, “hello %s”, NAME);

close(tempfile);

close(tempfile);

stop(0); // back to case list stop(1); // back to app list

stop(0); // back to case list stop(1); // back to app list

execpff(“myapp. ent”, wait); execpff(“myapp. ent”, stop);

execpff(“myapp. ent”, wait); execpff(“myapp. ent”, stop);

sysparm value = sysparm(“KEY”);

sysparm value = sysparm(“KEY”);

tonumber n = tonumber(“ 12. 5”);

tonumber n = tonumber(“ 12. 5”);

savesetting(“Interviewer. Name”, INTERVIEWER_NAME));

savesetting(“Interviewer. Name”, INTERVIEWER_NAME));

loadsetting string name = loadsetting( “Interviewer. Name”);

loadsetting string name = loadsetting( “Interviewer. Name”);

syncconnect synconnect(CSWeb, “https: //www. server. com”); synconnect(Bluetooth);

syncconnect synconnect(CSWeb, “https: //www. server. com”); synconnect(Bluetooth);

syncdata(PUT, MYDICT);

syncdata(PUT, MYDICT);

syncfile(PUT, “/localpath/file. txt”, “serverpath/”); syncfile(GET, “/serverpath/file. txt”, “serverpath/”);

syncfile(PUT, “/localpath/file. txt”, “serverpath/”); syncfile(GET, “/serverpath/file. txt”, “serverpath/”);

syncdisconnect();

syncdisconnect();

syncserver() syncserver(Bluetooth, “/path/to/root”);

syncserver() syncserver(Bluetooth, “/path/to/root”);