* Code written by Rolf Kjoeller. * This is to convert a syntax file into VB-syntax which may then be copied and pasted intodded a script. SET MPRINT=yes. DEFINE publish (!POSITIONAL !CMDEND) /* the syntaxfile is read as data; empty lines are deleted */ DATA LIST FILE=!1 /#text(A250) . SELECT IF NOT RTRIM(#text) EQ "" . /* double-quotes are replaced with single-quotes */ LOOP IF RINDEX(#text,'"') GT 0 . COMPUTE #pos=RINDEX(#text,'"') . COMPUTE #text=CONCAT(SUBSTR(#text,1,#pos-1),"'",SUBSTR(#text,#pos+1)) . END LOOP . /* strCommands are added */ STRING text (A250) . IF RTRIM(#text) NE "" text=CONCAT('strCommand = strCommand &','"',RTRIM(LTRIM(#text)),'" & vbCrLf') . /* the resulting script-code is listed: PRESERVE . SET WIDTH=250 . LIST CASES /VARIABLES text . RESTORE . !ENDDEFINE . * Call macro with the path of the file to be converted. publish "d:\\data\\syntax\\distributions\\Tests for significant differences in proportion.SPS" .