Run External Editor

Mike Kerner MikeKerner at roadrunner.com
Wed Oct 16 13:53:17 EDT 2013


and here's a sample macro file:

<macros>
//
// Macros.xml file.
//
// Description
// This file is created in the 4D folder at the first launch of the
database.
// It automatically creates several macro commands that can be enriched or
// modified. You can also add all the macros required for your own
development
// needs manually.
//
// List of default macro commands.
//
// Logical blocks
// --------------
// If "If" logical block
// IfElse "If" logical block with an "Else" proposition
// CaseOf "Case" logical block
// While "While" logical block
// For "For" logical block
// Repeat "Repeat" logical block
//
// Frequently-used database blocks
// -------------------------------
// "LoopRecord" Loop on a table selection with saving of
//            record (use a table name as selection)
// "LoopRecordNoSave" Loop on a table selection without saving
//            records (use a table name as selection)
//
// Useful blocks
// -------------
// "Header"    Header for method name
//
// "CodeModif" Adds 4D user name and date for development
//            in multi-user environment


// Mikey----------------------------------------------------------


<macro name="If Mikey">
<text>
If (<selection/>)
<caret/>
Else ` NOT (<selection/>)

End If `<selection/>
</text>
</macro>

<macro name="For Records In Selection">
<text>
For ($i;1;Records In Selection (<selection/>))
   GOTO SELECTED RECORD (<selection/>;$i)
   <caret/>
End for `$i;1;Records In Selection(<selection/>)
</text>
</macro>

<macro name="Case Mikey">
<text>
Case of
   :(<selection/>)
      <caret/>
   Else

End Case
</text>
</macro>

<macro name="While Mikey">
<text>
While (<selection/>)
   <caret/>
End While `<selection/>
</text>
</macro>

<macro name="Record Compare n Dare">
<text>
$testVal:=""
$tablePtr:=Table(Table(-><Selection/>))

for ($i;1;records in selection ($tablePtr->))
   GOTO Selected Record ($tablePtr->;$i)
   If ($testVal#<selection/>)
      $testVal:=<selection/>
      <caret/>
   Else ` $testVal=<selection/>

   End If `($testVal#<selection/>)
end for `($i;1;records in selection ($tablePtr->))
</text>
</macro>


// Logical blocks ________________________________________________
<macro name="If">
<text>
If(<caret/>)

End if

</text>
</macro>

<macro name="IfElse">
<text>
If(<caret/>)

Else

End if

</text>
</macro>

<macro name="CaseOf">
<text>
Case of
:(<caret/>)

End case

</text>
</macro>

<macro name="While">
<text>
While(<caret/>)

End while

</text>
</macro>

<macro name="For">
<text>
For(<caret/>;;)

End for

</text>
</macro>

<macro name="Repeat">
<text>
Repeat

Until(<caret/>)

</text>
</macro>


// Frequent database blocks ______________________________________
<macro name="LoopRecord">
<text>
While (Not(End selection(<selection/>)))
<caret/>
Save Record(<selection/>)
Next Record(<selection/>)
End while

</text>
</macro>

<macro name="LoopRecordNoSave">
<text>
While (Not(End selection(<selection/>)))
<caret/>
Next Record(<selection/>)
End while

</text>
</macro>


// Useful blocks _________________________________________________
<macro name="Header">
<text>
` ----------------------------------------------------
` User name (OS): <user_os/>
` Date and time: <date format="0"/>, <time format="0"/>
` ----------------------------------------------------
` Method: <method_name/>
` Description
` <caret/>
`
` Parameters
` ----------------------------------------------------

</text>
</macro>

<macro name="CodeModif">
<text>
` Modified by: <user_os/> (<date format="1"/>)

</text>
</macro>

</macros>





-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."



More information about the use-livecode mailing list