Mac-text
Hello, Could someone please enlighten me as to why ordinary text (no formatting) uploaded via ftp to a server behaves perfectly when uploading it from Windows, whereas on Mac all returns have disappeared and been replaced by lots of boxes? This is with MC2.4. The script I use: put ftp://username:[EMAIL PROTECTED]/diamp/Itadiamp/ItaRes/; kortfil into tilfil put fld utskrift of last cd into url tilfil Thanks in advance. -- 1. amanuensis Signe Marie Sanne e-mail: [EMAIL PROTECTED] Romansk Institutttel: +47 55 58 21 27 Oysteins gt. 1 5007 Bergen http://www.hf.uib.no/hfolk/mlab/default.html Norway Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: wait for moves
I have a script with a repeat loop that causes objects to move around the screen. Depending on user choices, sometimes there are simultaneous moving objects ( because without waiting was used for the objects move). This is the problem.. I want all the objects to finish their moves before the rest of the script executes. I need a line after the repeat loop like wait until the moves are done but that doesn't exist. Anyone have any ideas? Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Mac-text
Hi Signe Marie, Hello, Could someone please enlighten me as to why ordinary text (no formatting) uploaded via ftp to a server behaves perfectly when uploading it from Windows, whereas on Mac all returns have disappeared and been replaced by lots of boxes? This is with MC2.4. The script I use: put ftp://username:[EMAIL PROTECTED]/diamp/Itadiamp/ItaRes/; kortfil into tilfil put fld utskrift of last cd into url tilfil Thanks in advance. that is an very old and probably very little known problem. The MacOS handles chars with ascii-numbers 128 different than Windows/Unix does. That's why all chars aA to zZ and numbers from 0 to 9 always look OK and others don't. Thats why some french post here on the list sometimes look more like chinese...That is just a joke!!! I personally love france, french and the french people, mais bien sur... Some of my best friends are french, honestly... :-) I even saw this problem in professional (?) applications like Internet Explorer on Mac and on Win !!! But, thank Scott, there is MC. That will do the necessary translation, if we like to. Put these little functions in your stackscript and call them whenever you send or get (!) text over the net. Give them a norwegian name, to make it a bit more familiar ;-) function macorwin_out dertext ##german for the text :-) if the platform contains Mac then return mactoiso(dertext) else return dertext end if end macorwin_send function macorwin_in dertext if the platform contains Mac then return isotomac(dertext) else return dertext end if end macorwin_get In your example you should script: ... put ftp://username:[EMAIL PROTECTED]/diamp/Itadiamp/ItaRes/; kortfil into tilfil put macorwin_out(fld utskrift of last cd) into url tilfil ... When you received some text from the net, use the other function. . put macorwin_in(url tilfil) into fld whatever Hope that helps. Regards Klaus Major [EMAIL PROTECTED] MetaScape GmbH Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Mac-text
Signe Marie Sanne ecrivait / wrote: Could someone please enlighten me as to why ordinary text (no formatting) uploaded via ftp to a server behaves perfectly when uploading it from Windows, whereas on Mac all returns have disappeared and been replaced by lots of boxes? That is the different coding of end of paragraph between platforms. On the Mac, it is only char 13 (carriage return) The boxes are char 10 (line feed) -- Regards, Dominique Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Fonts
Hi Everyone, I'm working on a Mac, creating my first cross-platform stack, and I've read in the archives that Arial, Time New Roman and Helvetica are fairly safe fonts to use. Any others? Regards, Greg Gregory Lypny Associate Professor John Molson School of Business Concordia University Montreal, Canada It's not dark yet, But it's gettin' there. - Bob Dylan Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Mac-text
Signe Marie Sanne ecrivait / wrote: Could someone please enlighten me as to why ordinary text (no formatting) uploaded via ftp to a server behaves perfectly when uploading it from Windows, whereas on Mac all returns have disappeared and been replaced by lots of boxes? That is the different coding of end of paragraph between platforms. On the Mac, it is only char 13 (carriage return) The boxes are char 10 (line feed) -- Regards, Dominique Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: wait for moves
Hi Michael, I have a script with a repeat loop that causes objects to move around the screen. Depending on user choices, sometimes there are simultaneous moving objects ( because without waiting was used for the objects move). This is the problem.. I want all the objects to finish their moves before the rest of the script executes. I need a line after the repeat loop like wait until the moves are done but that doesn't exist. Anyone have any ideas? check out the movingcontrols or movingcontrols() function. Regards Klaus Major Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Visual effects and/or QT effects
[EMAIL PROTECTED] ecrivait / wrote: I use the following handler to deal with visual effects. Visual effects that are from the answer effect dialog have a long sequence of characters. I store these in separate fields. Then I just call their contents when I need them OKay! One cannot call directly a QT effect, in fact... I saw the long sequence of characters and thought it was an error ;-) With your method that works :-) All QT effects are OK but one (the first of them alternance) Effects 2 and 3 seem to do nothing. -- Regards, Dominique Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Fonts
Recently, Gregory Lypny wrote: I'm working on a Mac, creating my first cross-platform stack, and I've read in the archives that Arial, Time New Roman and Helvetica are fairly safe fonts to use. Any others? Verdana is also good for on-screen use. Regards, Scott _ Scott Rossi Tactile Media - Multimedia Design Creative Director Email: [EMAIL PROTECTED] Web: www.tactilemedia.com Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Visual effects and/or QT effects
[EMAIL PROTECTED] ecrivait / wrote: I use the following handler to deal with visual effects. Visual effects that are from the answer effect dialog have a long sequence of characters. I store these in separate fields. Then I just call their contents when I need them OKay! One cannot call directly a QT effect, in fact... I saw the long sequence of characters and thought it was an error ;-) With your method that works :-) All QT effects are OK but one (the first of them alternance) Effects 2 and 3 seem to do nothing. -- Regards, Dominique Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Fonts
Gregory Lypny asked: I've read in the archives that Arial, Time New Roman and Helvetica are fairly safe fonts to use. Any others? Helvetica is not listed in my MSWord. But Century, the Latinate font which my Japanese OS prefers, seems ubiquitous. Cheers. Nicolas Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Mac-text
At 9:54 AM -0600 10/31/01, Ken Ray wrote: This has to do with the fact that the Mac uses a carriage return/line-feed combination (CRLF) at the end of each line, and Windows generally uses just LFs (or is just CRs? I can't remember right now). CRs are ASCII 13, LFs are ASCII 10, BTW. In any event, when it gets to the Mac, it is missing the extra charater to indicate the end of the line. You can handle this in MC by reading in the text, doing a simple replace operation on the text before processing it. Macs use cr, Windows uses crlf, UNIX uses lf. Now all we need is a platform still using EBCDIC and we'll have a full house! :-) regards, Geoff Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: wait for moves
Recently, Michael Walas wrote: I have a script with a repeat loop that causes objects to move around the screen. Depending on user choices, sometimes there are simultaneous moving objects ( because without waiting was used for the objects move). This is the problem.. I want all the objects to finish their moves before the rest of the script executes. I need a line after the repeat loop like wait until the moves are done but that doesn't exist. Anyone have any ideas? One way is to tally all the moveStopped messages sent from your moving objects. You'll need to know all the objects that are moving and either: 1) if the last object to move will always arrive last at its destination, you can test for this object only in a moveStopped handler 2) build a list of the moving objects and then check them off one at time as they finish moving Regards, Scott _ Scott Rossi Tactile Media - Multimedia Design Creative Director Email: [EMAIL PROTECTED] Web: www.tactilemedia.com Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Mac-text
on 31/10/01 3:54 PM, Ken Ray at [EMAIL PROTECTED] wrote: This has to do with the fact that the Mac uses a carriage return/line-feed combination (CRLF) at the end of each line, and Windows generally uses just LFs (or is just CRs? I can't remember right now). CRs are ASCII 13, LFs are ASCII 10, BTW. on 31/10/01 10:18 AM, Signe Marie Sanne at [EMAIL PROTECTED] wrote: Could someone please enlighten me as to why ordinary text (no formatting) uploaded via ftp to a server behaves perfectly when uploading it from Windows, whereas on Mac all returns have disappeared and been replaced by lots of boxes? This is with MC2.4. T'other way, actually. Mac standard to represent a line break is CR; Unix standard is LF; DOS/Windows standard is CRLF. Things like this that make me despair of ever achieving standards... This is essentially (correct me if I'm wrong) the difference between 'open file for text' and 'open file for binary', or 'URL file:/...' and 'URL binfile:/...' - in each case, the first formulation instructs MetaCard to automatically scan the data, and convert all instances of CR or CRLF to LF. Virtually any FTP application will have the same facility, and have a setting that allows you to choose whether to transfer files in Text or Binary mode (often also some sort of 'automatic' mode in which it guesses whether a file is binary or text). So the real question is, using the FTP facilities in MC 2.4, is there a way to specify a similar switch? Or does the FTP library always transfer in Binary mode? Meanwhile, slightly off the original poster's question: CRs are ASCII 13, LFs are ASCII 10, BTW. Correct - but bizarrely, MetaCard defines constants named CR and return to have the value 10, instead of 13. A subtle gotcha for HC users who deal with binary data, and a wind-up (IMHO). You have to define your own 'constant' if you really want to deal with CR. I can (grudgingly) accept the definition of 'return' as linefeed; but defining a new constant CR, with the wrong value, is just rubbing salt in the wound. Was this inherited from some other xTalk? I suppose it's too late to appeal for a change in the value of CR; but how about at adding a couple of new constants, asciiCR with value 13, and CRLF with the value being a two-character string, codes 13 and 10? Ben Rubinstein | Email: [EMAIL PROTECTED] Cognitive Applications Ltd | Phone: +44 (0)1273-821600 http://www.cogapp.com| Fax : +44 (0)1273-728866 Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: wait for moves
At 7:08 PM +0100 10/31/01, Klaus Major wrote: Hi Michael, I have a script with a repeat loop that causes objects to move around the screen. Depending on user choices, sometimes there are simultaneous moving objects ( because without waiting was used for the objects move). This is the problem.. I want all the objects to finish their moves before the rest of the script executes. I need a line after the repeat loop like wait until the moves are done but that doesn't exist. Anyone have any ideas? check out the movingcontrols or movingcontrols() function. Also the moveStopped message. regards, gc Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Arrays! We have arrays?!?
I was amazed and delighted to learn MC had array tools! They could be a bazillion times faster than running thru a repeat loop But where are they? I looked under every bushel basket Scott has scattered around but could find nary a mention of array, itemArray, or thingieArray. These neat tools could be used by all, Scott, but just a little hint of their nature and the basic syntax. Even a couple of meaningful examples would be kind. Anyone out there know the source of the documentation for arrays? (Revolution has little to say on this subject, too.) Do squre brackets, [], define an array? Are arrays tab delimited, comma delimited or can any char work? Besides itemArray, what are the other array tools? So many questions, so little doc... How many other undocumented functions are there? [Of course, only Scott knows...] You are in a dark and twisty cave... Your options are Left, Right or Down -- Ray G. Miller --- Turtlelips Productions 4009 Everett Ave. Oakland, CA 94602 MailTo:[EMAIL PROTECTED] (V) 510.530.1971 (F) 510.482.3491 Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Arrays! We have arrays?!?
Ray G Miller wrote: I was amazed and delighted to learn MC had array tools! They could be a bazillion times faster than running thru a repeat loop But where are they? I looked under every bushel basket Scott has scattered around but could find nary a mention of array, itemArray, or thingieArray. These neat tools could be used by all, Scott, but just a little hint of their nature and the basic syntax. Even a couple of meaningful examples would be kind. Anyone out there know the source of the documentation for arrays? (Revolution has little to say on this subject, too.) Do squre brackets, [], define an array? Are arrays tab delimited, comma delimited or can any char work? Besides itemArray, what are the other array tools? So many questions, so little doc... I learned to enjoy that, there's always something new out there, all you need to do is ask;-) Read the README.2.4 for more details and also look in HelpIndex for items related to arrays, they are indeed beautiful. As for item delimiter you can use any. How many other undocumented functions are there? [Of course, only Scott knows...] You are in a dark and twisty cave... Your options are Left, Right or Down -- Ray G. Miller --- Andu Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Arrays! We have arrays?!?
At 1:37 PM + 10/31/01, Ray G Miller wrote: Do squre brackets, [], define an array? Are arrays tab delimited, comma delimited or can any char work? Besides itemArray, what are the other array tools? So many questions, so little doc... How many other undocumented functions are there? [Of course, only Scott knows...] Often it's more a case of there's so much to know, rather than there not being docs. In any case, if you open the help index and scroll to arrays, associative and click on it, you'll see the entry for containers. This does have a bit on arrays, you just have to scroll down to it. Arrays are denoted by brackets: a[1] is an array element. Arrays are not delimited by anything (although check out the new split and combine commands in 2.4) Arrays are associative. This means that anything is a valid key, rather than just numbers. You can use numbers, but you don't need to predefine the valid range of numbers, nor do you have to use them consecutively. Again, _anything_ is a valid key. phoneNumbers[Geoff Canyon] is perfectly valid, and could store my phone number. This fact combined with the keys() function can be used in some interesting ways. Have fun, associative arrays are a kick! gc Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Mac-text
Ben, Thanks for the clarification... I *knew* I'd forgotten something... As for your comment about CRLF, VB has that as a constant (vbCRLF), so why shouldn't MetaCard? ;-) Ken Ray Sons of Thunder Software Email: [EMAIL PROTECTED] Website: http://www.sonsothunder.com/ - Original Message - From: Ben Rubinstein [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 31, 2001 12:46 PM Subject: Re: Mac-text on 31/10/01 3:54 PM, Ken Ray at [EMAIL PROTECTED] wrote: This has to do with the fact that the Mac uses a carriage return/line-feed combination (CRLF) at the end of each line, and Windows generally uses just LFs (or is just CRs? I can't remember right now). CRs are ASCII 13, LFs are ASCII 10, BTW. on 31/10/01 10:18 AM, Signe Marie Sanne at [EMAIL PROTECTED] wrote: Could someone please enlighten me as to why ordinary text (no formatting) uploaded via ftp to a server behaves perfectly when uploading it from Windows, whereas on Mac all returns have disappeared and been replaced by lots of boxes? This is with MC2.4. T'other way, actually. Mac standard to represent a line break is CR; Unix standard is LF; DOS/Windows standard is CRLF. Things like this that make me despair of ever achieving standards... This is essentially (correct me if I'm wrong) the difference between 'open file for text' and 'open file for binary', or 'URL file:/...' and 'URL binfile:/...' - in each case, the first formulation instructs MetaCard to automatically scan the data, and convert all instances of CR or CRLF to LF. Virtually any FTP application will have the same facility, and have a setting that allows you to choose whether to transfer files in Text or Binary mode (often also some sort of 'automatic' mode in which it guesses whether a file is binary or text). So the real question is, using the FTP facilities in MC 2.4, is there a way to specify a similar switch? Or does the FTP library always transfer in Binary mode? Meanwhile, slightly off the original poster's question: CRs are ASCII 13, LFs are ASCII 10, BTW. Correct - but bizarrely, MetaCard defines constants named CR and return to have the value 10, instead of 13. A subtle gotcha for HC users who deal with binary data, and a wind-up (IMHO). You have to define your own 'constant' if you really want to deal with CR. I can (grudgingly) accept the definition of 'return' as linefeed; but defining a new constant CR, with the wrong value, is just rubbing salt in the wound. Was this inherited from some other xTalk? I suppose it's too late to appeal for a change in the value of CR; but how about at adding a couple of new constants, asciiCR with value 13, and CRLF with the value being a two-character string, codes 13 and 10? Ben Rubinstein | Email: [EMAIL PROTECTED] Cognitive Applications Ltd | Phone: +44 (0)1273-821600 http://www.cogapp.com| Fax : +44 (0)1273-728866 Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list. Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Mac-text
Ken Ray wrote: Ben, Thanks for the clarification... I *knew* I'd forgotten something... As for your comment about CRLF, VB has that as a constant (vbCRLF), so why shouldn't MetaCard? ;-) Seconded (that's the only ToolBook token I fell in love with). -- Richard Gaskin Fourth World Media Corporation Custom Software and Web Development for All Major Platforms Developer of WebMerge 1.8: Publish your database on the Web ___ [EMAIL PROTECTED] http://www.FourthWorld.com Tel: 323-225-3717 AIM: FourthWorldInc Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: wait for moves
This list is the best! The line below worked. Thanks everybody. How about: wait until the movingControls = empty Maybe that'll do it. Phil I wrote: I have a script with a repeat loop that causes objects to move around the screen. Depending on user choices, sometimes there are simultaneous moving objects ( because without waiting was used for the objects move). This is the problem.. I want all the objects to finish their moves before the rest of the script executes. I need a line after the repeat loop like wait until the moves are done but that doesn't exist. Anyone have any ideas? Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Fonts
Thanks, Nicholas and Scott for the font advice. Greg _ Gregory Lypny Associate Professor of Finance John Molson School of Business Concordia University _ Take chances, make mistakes! - Ms Frizzle, The Magic School Bus E-mail forum: [EMAIL PROTECTED] Visit Pareto at http://rubbersoul.concordia.ca Visit Borsa at http://rubbersoul.concordia.ca/Borsa_Classroom Crash site for notes and quizzes at http://homepage.mac.com/gregorylypny/FileSharing1.html Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
RE: Fonts
Fonts are a bugger! I can't remember the url but if you search for fonts on the Microsoft website you will find a cross platform package of fonts that are free to download and are also distributed with IE 5. I think you can even distribute them but I'm not sure. Note that Windows 95 has a very limited set of fonts and unless they have installed IE 5 or Office then you will have trouble. Also Arial is quite a bit larger on MacOS. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Scott Rossi Sent: Thursday, 1 November 2001 6:06 AM To: [EMAIL PROTECTED] Subject: Re: Fonts Recently, Gregory Lypny wrote: I'm working on a Mac, creating my first cross-platform stack, and I've read in the archives that Arial, Time New Roman and Helvetica are fairly safe fonts to use. Any others? Verdana is also good for on-screen use. Regards, Scott _ Scott Rossi Tactile Media - Multimedia Design Creative Director Email: [EMAIL PROTECTED] Web: www.tactilemedia.com Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list. Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: RFC: Optimizing stripDup()
On 10/29/01 11:09 PM, eugen helbling wrote: Hi LiangTyan, just to demonstrate that the new split(I like them) can do in case of duplicate removing. for example you have a field/variable having something like nameA,firstnameB cr nameA,firstnameC in it, you can use split handler to select names witout duplicates. get nameA,firstnameB cr nameA,firstnameC split it by return and comma get the keys of it -- in it you have nameA only one time This could be a good trick on eliminating duplicate records, but I realised it could be a problem on URL parsing. If you try to submit a series of check-buttons or radio-buttons with browser: htmlheadtitleMetaCard split test/title/head body form action=http://localhost/cgi-bin/echo.mt; method=get input type=checkbox value=1 name=option checkedOption 1 pinput type=checkbox value=2 name=option checkedOption 2/p pinput type=checkbox value=3 name=option checkedOption 3/p pinput type=submit /form /body/html The browser constructs the the following string and pass onto the server: http://localhost/cgi-bin/echo.mt?option=1option=2option=3 Suppose you are using a split command to parse the query string in the echo.mt script: put $QUERY_STRING into x split x by and = put keys(x) into xKeys you'll get only option in xKeys, and x[option] gives you 3. Hmm. should I bug report this? Regards, LiangTyan Fui regards eugen LiangTyan Fui wrote: Here is a function that I've written quite some time ago. It takes a list of text theList, separated by theitemDel, remove duplicate items in the list, and returns a new list without duplicate items. Unfortunately, this function running rather slowly on a large list (a few thousands records) - that is why I am posting here as a little open source, Request For Comment: Make it faster guys! Remember, the sequence of the records cannot be changed, that say you are not likely to use sort. Regards, LiangTyan Fui # function stripDup theList,theitemDel # verify param if theList= then return if theitemDel = then put cr into theitemDel # set theitemDel to char 1 of theitemDel put number of items of theList into theListItem put 1 into k repeat put item k of theList into key1 repeat with c = theListItem down to k+1 if key1 = item c of theList then delete item c of theList subtract 1 from theListItem end if end repeat if k = theListItem then exit repeat add 1 to k end repeat return theList end stripDup Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list. Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: RFC: Optimizing stripDup()
LiangTyan Fui wrote: On 10/29/01 11:09 PM, eugen helbling wrote: Hi LiangTyan, just to demonstrate that the new split(I like them) can do in case of duplicate removing. for example you have a field/variable having something like nameA,firstnameB cr nameA,firstnameC in it, you can use split handler to select names witout duplicates. get nameA,firstnameB cr nameA,firstnameC split it by return and comma get the keys of it -- in it you have nameA only one time This could be a good trick on eliminating duplicate records, but I realised it could be a problem on URL parsing. If you try to submit a series of check-buttons or radio-buttons with browser: htmlheadtitleMetaCard split test/title/head body form action=http://localhost/cgi-bin/echo.mt; method=get input type=checkbox value=1 name=option checkedOption 1 pinput type=checkbox value=2 name=option checkedOption 2/p pinput type=checkbox value=3 name=option checkedOption 3/p pinput type=submit /form /body/html The browser constructs the the following string and pass onto the server: http://localhost/cgi-bin/echo.mt?option=1option=2option=3 Suppose you are using a split command to parse the query string in the echo.mt script: put $QUERY_STRING into x split x by and = put keys(x) into xKeys you'll get only option in xKeys, and x[option] gives you 3. Hmm. should I bug report this? Would you like to have? x[option]=1 and x[option]=2 and x[option]=3 ? I'd say it's normal behavior to retain only the last given value. Regards, LiangTyan Fui Andu Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.