X\ e$MG|0v3X ( @ (//(  0/80@0?/8 0( ?G@POWOXOP?H0@/7@O_``h_hPX 0(P_oppxow_g@O/8'' 7p`o?G/7 0??H/8`/o?GOX@H0?/pOW?H/8 7OP?G/7( P0@PX@O0@ 0O @H/@' 00@@P0?'_OP@H( 7/7' ^^^^^^^^^^^^^^^^^^^^^^^^^^TeeBBBBeTT^^^^^^^eBDJ33333JJDBeZ^^^^TD33==#####==3JDBT^^^^eJ=###=3DeZ^^TB3# #=3JBZ^^T3#  #=JBT^^J# Sll #=JBZ^T# %,68??86,/@A*< ##45('.6787-9%:;*<=#$+&,--.,/01)2 3 $%&&'%($!)* ##  !"#     ??ddz@font0Arial object0 c readstring6"This is a test for finding the letter x in something"000000ci show_info()0000001000000000000000000daction_if_variablestring_char_at(readstring,i)"x"00000000000000ci100000000000000 action_font 00000000action_draw_text&"Character x at position " + string(i)10010000000room0        pXGame InformationX{\rtf1\ansi\ansicpg1252\deff0\deflang3081{\fonttbl{\f0\fnil\fcharset0 Arial;}{\f1\fnil MS Sans Serif;}{\f2\fnil\fcharset0 MS Sans Serif;}{\f3\fnil Arial;}} {\colortbl ;\red0\green0\blue0;} \viewkind4\uc1\pard\cf1\b\fs24 Using Loops in drag and drop programming \par Tony Forster June 2006 \par \b0 \par Though loops are best set up using code, simple loops can be set up with drag and drop programming using the repeat and exit statement. \par \par In this case, a string is scanned letter by letter to find the first occurrence of the letter x \par \par \pard\cf0\b\f1 Information about object: object0 \par \b0\fs16 \par Sprite: \par Solid: false \par Visible: true \par Depth: 0 \par Persistent: false \par Parent: \par Mask: \par \par \b Create Event: \par \b0 set variable readstring to "This is a test for finding the letter x in something" \par set variable i to show_info()\f2\tab\tab\tab\tab //initialising the loop counter i and \par \tab\tab\tab\tab\tab\tab //displaying the help all in one line\f1 \par repeat next action (block) 1000 times\f2\tab\tab\tab //there is no loop forever but you can \par \tab\tab\tab\tab\tab\tab //set up a large number of loops\f1 \par if string_char_at(readstring,i) is equal to "x" \par exit this event\f2\tab\tab\tab\tab //exit the event with i position in string\f1 \par set variable i relative to 1 \par \par \b Draw Event: \par \b0 set the font for drawing text to font0 and align left \par at position (100,100) draw text: "Character X at position " + string(i) \par ______________________________________________________ \par \pard\cf1\f3\fs24 \par } SpritesSounds BackgroundsPathsScripts Fonts font0 Time LinesObjectsobject0Roomsroom0 Game Information Global Game Settings