<?xml version="1.0" encoding="utf-8"?>
<Application>
	<AppTitle>rreyCompare</AppTitle>
	<Author>Gaev Keeka</Author>
	<DesignDeviceName>Desktop</DesignDeviceName>
	<VariablesScanned>False</VariablesScanned>
	<PageWidth>800</PageWidth>
	<PageHeight>600</PageHeight>
	<AutoSizeWidth>False</AutoSizeWidth>
	<AutoSizeHeight>False</AutoSizeHeight>
	<HideScrollbars>False</HideScrollbars>
	<PublishPlatform>WebApp</PublishPlatform>
	<EmptyBuildFolder>False</EmptyBuildFolder>
	<CustomCSS>.goodCompare {
  color: green;
}

.badCompare {
  color: red;
}</CustomCSS>
	<LanguageCode>en</LanguageCode>
	<MobileOSTypes>[AndroidOS,iOS,WindowsPhoneOS]</MobileOSTypes>
	<WindowState>normal</WindowState>
	<TitleBar>True</TitleBar>
	<Sizeable>True</Sizeable>
	<MaximizeBtn>False</MaximizeBtn>
	<MinimizeBtn>True</MinimizeBtn>
	<SystemMenu>True</SystemMenu>
	<ContextMenu>False</ContextMenu>
	<AlwaysOnTop>False</AlwaysOnTop>
	<ShowInTaskbar>True</ShowInTaskbar>
	<SingleInstance>False</SingleInstance>
	<ChromeKioskMode>False</ChromeKioskMode>
	<startup>TopCenterApp</startup>
	<Components>
		<FunctionList name="Subroutines">
			<Components>
				<Function name="ShowTextDifferences">
					<Code>... [Trace] is for testing only
SetVar &quot;[Trace]&quot; &quot;&quot;

... result html to be returned by subroutine
SetVar [ResultInHTML] &quot;&quot;

... string lengths and corresponding max values for loop/endloop
StrLen &quot;[String1]&quot; [String1Len]
Math &quot;[String1Len] - 1&quot; 0 [LoopMax1]

StrLen &quot;[String2]&quot; [String2Len]
Math &quot;[String2Len] - 1&quot; 0 [LoopMax2]

... compare lengths to determine maximum loop count
If [LoopMax1] &gt;= [LoopMax2]
   SetVar &quot;[LoopMax]&quot; &quot;[LoopMax1]&quot;
Else
   SetVar &quot;[LoopMax]&quot; &quot;[LoopMax2]&quot;
EndIf

Loop 0 [LoopMax] [thisCharPosition]
     If &quot;[thisCharPosition]&quot; &quot;&gt;&quot; &quot;[LoopMax1]&quot;
        ... string1 is shorter than this position
        SetVar &quot;[thisCharString1]&quot; &quot;&quot;
        SetVar &quot;[upperCharString1]&quot; &quot;&quot;
     Else
        SubStr &quot;[String1]&quot; [thisCharPosition] 1 [thisCharString1]
        StrUpper &quot;[thisCharString1]&quot; [upperCharString1]
     EndIf

     If &quot;[thisCharPosition]&quot; &quot;&gt;&quot; &quot;[LoopMax2]&quot;
        ... string2 is shorter than this position
        SetVar &quot;[thisCharString2]&quot; &quot;&quot;
        SetVar &quot;[upperCharString2]&quot; &quot;&quot;
     Else
        SubStr &quot;[String2]&quot; [thisCharPosition] 1 [thisCharString2]
        StrUpper &quot;[thisCharString2]&quot; [upperCharString2]
     EndIf

     ... compare based on variable [Case]
     If &quot;[Case]&quot; &quot;==&quot; &quot;CaseMatters&quot;
        ... b is not same as B; compare original data
        If [thisCharString1] === [thisCharString2]
           SetVar &quot;[CharCompared]&quot; &quot;Yes&quot;
        Else
           SetVar &quot;[CharCompared]&quot; &quot;No&quot;
        EndIf
     Else
         ... b is same as B; compare uppercased characters
        If [upperCharString1] === [upperCharString2]
           SetVar &quot;[CharCompared]&quot; &quot;Yes&quot;
        Else
           SetVar &quot;[CharCompared]&quot; &quot;No&quot;
        EndIf
     EndIf

     ... now act on comparison
     If [CharCompared] === &quot;Yes&quot;
        SetVar [ResultInHTML] &quot;[ResultInHTML]&lt;span class=&apos;goodCompare&apos;&gt;[ThisCharString2]&lt;/span&gt;&quot;
     Else
         If [thisCharString2] == &quot;&quot;
            ... String2 is shorter
            SetVar [ResultInHTML] &quot;[ResultInHTML]&lt;span class=&apos;badCompare&apos;&gt;?&lt;/span&gt;&quot;
         Else
            ... no match for this character
            SetVar [ResultInHTML] &quot;[ResultInHTML]&lt;span class=&apos;badCompare&apos;&gt;[ThisCharString2]&lt;/span&gt;&quot;
         EndIf
     EndIf

     ... trace the logic; for testing only
     SetVar &quot;[thisTrace]&quot; &quot;[thisCharPosition] ... [CharCompared]&lt;br/&gt;&quot;
     SetVar &quot;[thisTrace]&quot; &quot;[thisTrace][thisCharString1] ... [thisCharString2]&lt;br/&gt;&quot;
     ... accumulate trace
     SetVar &quot;[Trace]&quot; &quot;[Trace][thisTrace]&lt;br/&gt;&quot;
EndLoop
... for testing only
... AlertBox &quot;Trace&quot; &quot;[Trace]&quot; &quot;&quot;</Code>
					<Params>[String1]|STRING|First of 2 strings to compare;[String2]|STRING|Second of 2 strings to compare;[Case]|STRING|Type CaseMatters if b is not same as B;[ResultInHTML]|VARNAME|Show Differences in HTML</Params>
				</Function>
			</Components>
		</FunctionList>
		<LibraryList name="Libraries"/>
		<PageList name="Main">
			<Components>
				<Page id="MasterTextPage">
					<Components>
						<TextInput id="MasterTextInput">
							<left>200px</left>
							<top>64px</top>
							<width>512px</width>
							<height>40px</height>
							<variable>[MasterText]</variable>
							<init_value>The quick brown fox</init_value>
						</TextInput>
						<PushButton id="GoToUserInputPage">
							<left>200px</left>
							<top>112px</top>
							<width>160px</width>
							<height>40px</height>
							<caption>Go to UserText Page</caption>
							<click>...AlertBox &quot;MasterText&quot; &quot;[MasterText]&quot; &quot;&quot;
GotoPage &quot;UserTextPage&quot;</click>
						</PushButton>
						<Container id="MasterTextInputLabel">
							<left>200px</left>
							<top>32px</top>
							<width>160px</width>
							<height>24px</height>
							<style>background-color:#fff;border-style:solid;border-width:0px</style>
							<html>Enter Master Text below</html>
						</Container>
					</Components>
				</Page>
				<Page id="UserTextPage">
					<Components>
						<TextInput id="UserTextInput">
							<left>120px</left>
							<top>88px</top>
							<width>584px</width>
							<height>56px</height>
							<variable>[UserText]</variable>
						</TextInput>
						<Container id="UserTextInputLabel">
							<left>120px</left>
							<top>56px</top>
							<width>144px</width>
							<height>24px</height>
							<style>background-color:#fff;border-style:solid;border-width:0px</style>
							<html>Enter User Text below</html>
						</Container>
						<PushButton id="CompareButton">
							<left>120px</left>
							<top>160px</top>
							<width>208px</width>
							<height>40px</height>
							<caption>Compare this to Master Text</caption>
							<click>... use this if B is NOT same as b
...ShowTextDifferences &quot;[MasterText]&quot; &quot;[UserText]&quot; &quot;CaseMatters&quot; &quot;[CompareResultHTML]&quot;

... use this if B IS same as b
ShowTextDifferences &quot;[MasterText]&quot; &quot;[UserText]&quot; &quot;&quot; &quot;[CompareResultHTML]&quot;

... now populate object with resulting HTML
SetObjectHTML &quot;CompareResultHTML&quot; &quot;Result of comparison ...&lt;br/&gt;[CompareResultHTML]&quot;</click>
						</PushButton>
						<Container id="CompareResultHTML">
							<left>120px</left>
							<top>240px</top>
							<width>584px</width>
							<height>56px</height>
							<style>border-width:1px;border-style:solid;background-color:#fff;</style>
						</Container>
					</Components>
				</Page>
			</Components>
		</PageList>
		<PageList name="Master">
			<Components>
				<Page id="MasterPage"/>
			</Components>
		</PageList>
		<PageList name="Dialog">
			<Components>
				<Page id="NewDialog">
					<Components>
						<DialogContainer id="DialogContainer1">
							<left>0px</left>
							<top>0px</top>
							<width>800px</width>
							<height>600px</height>
							<close_button>False</close_button>
						</DialogContainer>
					</Components>
				</Page>
			</Components>
		</PageList>
	</Components>
</Application>
