switch

Jim Ault JimAultWins at yahoo.com
Sat Mar 18 23:24:56 EST 2006


Many on the list use the aforementioned naming convention.
This is especially important in groups, like Fourth World.

Ahh, but I am stuck in the past and my ways... thus.....
I prefer not to use this style, so my offerings will have a different look.
I do use the gGlobalName convention.
Also, every list of lines I use is whateverList
array is whateverArr

When I create a path name to refer to files or servers I use "pathh" because
in VB 'path' is a reserved word, in which I also do programming
then pathhFN is the (path name + file name)
and fpathhFN is the ("file:" +path name + file name)
so that I can do the following:

put the defaultfolder into pathh
if the last char of pathh is not "/" then put "/" after pathh

put the files into fileList
put line 1 of the fileList into FN
if ".txt" is in FN then put pathh & FN into pathhFN

put "file:"&pathhFN into fpathhFN

put "Mary had a lamb" into url fpathhFN

answer folder "Choose the folder please"
put it into pathh
if the last char of pathh is not "/" then put "/" after pathh
put "file:"&pathh into fpathh
put the detailed files into fileList
put empty into appendedContents
repeat for each line LNN in fileList
   if LNN contains ".txt" then
       --write the directory and file name to a variable
      put cr & cr & pathh & ",  " & LNN) & " ------" after appendedContents
       --now write the contents of the file on the next lines
      put cr & url (fpathh&LNN) after appendedContents
   end if
end repeat
--now write a new file that is appendedContents
put appendedContents into url (fpathh&"appndMalarky.txt")

Lots of fun, and lots of choices.  And it's Saturday night :-)

Jim Ault
Las Vegas


On 3/18/06 7:39 PM, "John Tregea" <john at debraneys.com> wrote:

> Hi,
> 
> Just a question regarding the form many of you use for naming variables.
> I see a lot of variable names starting with 't' and wondered what it
> indicates. I use 'g' as a prefix for my global variables but that is all.
> 
> John (Ready to say "Duh"...) T
> 
> Klaus Major wrote:
>> Hi Liam,
>> 
>>> what am I doing wrong here
>>> 
>>> put fld "total" into ttotal
>>>   put fld "paymenttype" into tpayment
>>> ##!!  switch "tpayment"
>> ## No quotes, since this is a variable!
>>>   case "credit"
>>>  ## if tpayment contains "credit" then put ttotal into fld "CreditDb"
>> ## If tpayment = "credit" then it also contains "credit"! :-)
>>> ##exit switch
>> BREAK
>>> case "cash"
>>> ##if tpayment contains "cash" then put ttotal into fld "cash2"
>> ## See above
>>> ##exit switch
>> break
>>> end switch
>> 
>> this should work:
>> ...
>>   put fld "total" into ttotal
>>   put fld "paymenttype" into tpayment
>>   switch tpayment
>>   case "credit"
>>     put ttotal into fld "CreditDb"
>>     break
>>   case "cash"
>>     put ttotal into fld "cash2"
>>     break
>>   end switch
>> ...
>> 
>> Hope that helps.
>> 
>>> Liam Lambert
>>> liamlambert at mac.com
>>> IRELAND
>> 
>> Regards
>> 
>> Klaus Major
>> klaus at major-k.de
>> http://www.major-k.de
>> 
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>> 
>> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the Use-livecode mailing list