Spaced Out

2010-09-05 Thread Richmond

I am poking around in a textField to ascertain if the
double-byte char just before the insertion point is either:

1. Bang up against the left-hand side of the textField

or

2. A space.

#1 is dead easy; the space is proving rather difficult.

My code goes something like this:

on mouseUp
   set the useUnicode to true
  put the word 4 of the selectedChunk into W4
  put (W4 - 1) into W5
  get charToNum(char W5 to W4 of fld "MyGuff")
if it = empty or space then
   put "EMPTY or SPACE"
else
   put "STUFF HERE"
end if
end mouseUp

tried replacing "space" with "32"

for some funny reason this detects the left-hand side of the fld "MyGuff",
but not if there is a space on the left of the insertion point.

A real bu**er right now.

sincerely, Richmond.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Spaced Out

2010-09-05 Thread Richmond

Running a detection script like this:

on mouseUp
   set the useUnicode to true
   put the word 4 of the selectedChunk into W4
   put (W4 - 1) into W5
  get charToNum(char W5 to W4 of fld "MyGuff")
  put it into UNIK
   put the word 2 of the selectedChunk into W2
   put (W2 - 1) into W!
  get charToNumber(char W2 to W1 of fld "MyGuff")
  put it into UNIQ
   put uniEncode("The insertion point is between '") into P1
   put uniEncode("' and '") into P2
   put uniEncode("'") into P3
   set the unicodeText of fld "WhereAreWe" to P1 & numToChar(UNIK) & P2 
& numToChar(UNIQ) & P3

end mouseUp


detects a SPACE when the insertion point is BEFORE the space, but

does NOT detect a SPACE when the insertion point is AFTER a space.

-

Where am I going wrong?
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Spaced Out

2010-09-05 Thread Mark Schonewille
Hi Richmond,

You have W! instead of W1. W1 is undefined. Also, shouldn't it be W4-1 and 
W2+1? Have you checked that W4 > W2? I know, this is a tricky thing, struggled 
a lot with it myself.



--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

From 15th August, we'll have time for new projects! Be the first in line and 
contact me now!

Download the Installer Maker plugin for Runtime Revolution at http://qurl.tk/ce

On 5 sep 2010, at 12:33, Richmond wrote:

> Running a detection script like this:
> 
> on mouseUp
>   set the useUnicode to true
>   put the word 4 of the selectedChunk into W4
>   put (W4 - 1) into W5
>  get charToNum(char W5 to W4 of fld "MyGuff")
>  put it into UNIK
>   put the word 2 of the selectedChunk into W2
>   put (W2 - 1) into W!
>  get charToNumber(char W2 to W1 of fld "MyGuff")
>  put it into UNIQ
>   put uniEncode("The insertion point is between '") into P1
>   put uniEncode("' and '") into P2
>   put uniEncode("'") into P3
>   set the unicodeText of fld "WhereAreWe" to P1 & numToChar(UNIK) & P2 & 
> numToChar(UNIQ) & P3
> end mouseUp
> 
> 
> detects a SPACE when the insertion point is BEFORE the space, but
> 
> does NOT detect a SPACE when the insertion point is AFTER a space.

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Spaced Out

2010-09-05 Thread Richmond

On 09/05/2010 02:04 PM, Mark Schonewille wrote:

Hi Richmond,

You have W! instead of W1. W1 is undefined. Also, shouldn't it be W4-1 and W2+1? 
Have you checked that W4>  W2? I know, this is a tricky thing, struggled a lot 
with it myself.


   


Yes, it should be W2 + 1, and that was me being careless copying the 
script into my e-mail client; as with 'W!'.


The script still has the same problem.
 I will keep on fiddling around; Thanks for the support.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

 From 15th August, we'll have time for new projects! Be the first in line and 
contact me now!

Download the Installer Maker plugin for Runtime Revolution at http://qurl.tk/ce

On 5 sep 2010, at 12:33, Richmond wrote:

   

Running a detection script like this:

on mouseUp
   set the useUnicode to true
   put the word 4 of the selectedChunk into W4
   put (W4 - 1) into W5
  get charToNum(char W5 to W4 of fld "MyGuff")
  put it into UNIK
   put the word 2 of the selectedChunk into W2
   put (W2 - 1) into W!
  get charToNumber(char W2 to W1 of fld "MyGuff")
  put it into UNIQ
   put uniEncode("The insertion point is between '") into P1
   put uniEncode("' and '") into P2
   put uniEncode("'") into P3
   set the unicodeText of fld "WhereAreWe" to P1&  numToChar(UNIK)&  P2&  
numToChar(UNIQ)&  P3
end mouseUp


detects a SPACE when the insertion point is BEFORE the space, but

does NOT detect a SPACE when the insertion point is AFTER a space.
 

___
use-revolution mailing list
use-revolution@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Spaced Out

2010-09-05 Thread Richmond

I wonder why this doesn't work:

put the char before the selectedText

and nor does this:

put the char before the selectedChunk

?

Richmond.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Spaced Out

2010-09-05 Thread Richmond

Cracked It!
 And a right "@#$%^" it is too . . .  :(

Running a detection script like this:

on mouseUp
   set the useUnicode to true
   put the word 4 of the selectedChunk into W4
   put (W4 - 1) into W5
  get charToNum(char W5 to W4 of fld "MyGuff")
  put it into UNIK
   put the word 2 of the selectedChunk into W2
   put (W2 - 1) into W!
  get charToNumber(char W2 to W1 of fld "MyGuff")
  put it into UNIQ
   put uniEncode("The insertion point is between '") into P1
   put uniEncode("' and '") into P2
   put uniEncode("'") into P3
   set the unicodeText of fld "WhereAreWe" to P1&  numToChar(UNIK)&  P2&  
numToChar(UNIQ)&  P3
end mouseUp


detects a SPACE when the insertion point is BEFORE the space, but

does NOT detect a SPACE when the insertion point is AFTER a space.
 
   


to detect a SPACE one has to TURN OFF useUnicode:

set the useUnicode to false
  put the word 4 of the selectedChunk into WONKY
  get charToNum(char WONKY of fld "MyGuff")
  put it
set the useUnicode to true

"somebody", cough, cough, ought to get all this sorted out in the 
Documentation.

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Spaced Out

2010-09-05 Thread Mark Schonewille
Hi Richmond,

Are you doing this on a PowerPC processor? I think your script will break on a 
computer with x86 processor. In unicode, a space still is space & NULL on x86 
platforms and NULL & space on PPC platforms. Your script seems to find a space 
on PPC platforms but a NULL character on x86 platforms.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

From 15th August, we'll have time for new projects! Be the first in line and 
contact me now!

Download the Installer Maker plugin for Runtime Revolution at http://qurl.tk/ce

On 5 sep 2010, at 13:57, Richmond wrote:

> Cracked It!
> And a right "@#$%^" it is too . . .  :(
>>> Running a detection script like this:
>>> 
>>> on mouseUp
>>>   set the useUnicode to true
>>>   put the word 4 of the selectedChunk into W4
>>>   put (W4 - 1) into W5
>>>  get charToNum(char W5 to W4 of fld "MyGuff")
>>>  put it into UNIK
>>>   put the word 2 of the selectedChunk into W2
>>>   put (W2 - 1) into W!
>>>  get charToNumber(char W2 to W1 of fld "MyGuff")
>>>  put it into UNIQ
>>>   put uniEncode("The insertion point is between '") into P1
>>>   put uniEncode("' and '") into P2
>>>   put uniEncode("'") into P3
>>>   set the unicodeText of fld "WhereAreWe" to P1&  numToChar(UNIK)&  P2&  
>>> numToChar(UNIQ)&  P3
>>> end mouseUp
>>> 
>>> 
>>> detects a SPACE when the insertion point is BEFORE the space, but
>>> 
>>> does NOT detect a SPACE when the insertion point is AFTER a space.
>>> 
>>   
> 
> to detect a SPACE one has to TURN OFF useUnicode:
> 
> set the useUnicode to false
>  put the word 4 of the selectedChunk into WONKY
>  get charToNum(char WONKY of fld "MyGuff")
>  put it
> set the useUnicode to true
> 
> "somebody", cough, cough, ought to get all this sorted out in the 
> Documentation.


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Spaced Out

2010-09-05 Thread Richmond

On 09/05/2010 03:06 PM, Mark Schonewille wrote:

Hi Richmond,

Are you doing this on a PowerPC processor? I think your script will break on a computer 
with x86 processor. In unicode, a space still is space&  NULL on x86 platforms and 
NULL&  space on PPC platforms. Your script seems to find a space on PPC platforms 
but a NULL character on x86 platforms.

--
Best regards,

Mark Schonewille

   


Muffled curses.

Aaaah, so as well as having to make different stacks for the Mac/WinXP 
versus Win7/Linux divide

I now have to make different stacks for PPC and x86 processors.

Lovely!



Err . . . hang on a minute . . . a null 

Well; let me see on the Linux box whether my script works or not.

Back "in a trice"

Richmond.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Spaced Out

2010-09-05 Thread Richmond

On 09/05/2010 03:06 PM, Mark Schonewille wrote:

Hi Richmond,

Are you doing this on a PowerPC processor? I think your script will break on a computer 
with x86 processor. In unicode, a space still is space&  NULL on x86 platforms and 
NULL&  space on PPC platforms. Your script seems to find a space on PPC platforms 
but a NULL character on x86 platforms.

   


Well . . . talk about opening a can of worms . . .

You are quite right about the SPACE detection on an x86 processor . . .

And, what is also worrying is that Sanskrit vowel characters can't be 
entered

without preceding consonants being entered at the same time.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Spaced Out

2010-09-05 Thread Richmond

On 09/05/2010 03:06 PM, Mark Schonewille wrote:

Hi Richmond,

Are you doing this on a PowerPC processor? I think your script will break on a 
computer with x86 processor.


I am not sure what you mean by 'break'; the script does not crash the 
stack - it just doesn't detect

spaces properly.


In unicode, a space still is space&  NULL on x86 platforms and NULL&  space on 
PPC platforms. Your script seems to find a space on PPC platforms but a NULL character 
on x86 platforms.

--
Best regards,

Mark Schonewille

   


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Spaced Out

2010-09-05 Thread Mark Schonewille
Hi Richmond,

That's what I mean by break: first it works, then it doesn't.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

From 15th August, we'll have time for new projects! Be the first in line and 
contact me now!

Download the Installer Maker plugin for Runtime Revolution at http://qurl.tk/ce

On 5 sep 2010, at 14:43, Richmond wrote:

> On 09/05/2010 03:06 PM, Mark Schonewille wrote:
>> Hi Richmond,
>> 
>> Are you doing this on a PowerPC processor? I think your script will break on 
>> a computer with x86 processor.
> 
> I am not sure what you mean by 'break'; the script does not crash the stack - 
> it just doesn't detect
> spaces properly.
> 
>> In unicode, a space still is space&  NULL on x86 platforms and NULL&  space 
>> on PPC platforms. Your script seems to find a space on PPC platforms but a 
>> NULL character on x86 platforms.
>> 
>> --
>> Best regards,
>> 
>> Mark Schonewille
>> 
>>
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Spaced Out

2010-09-05 Thread Richmond

On 09/05/2010 05:58 PM, Mark Schonewille wrote:

Hi Richmond,

That's what I mean by break: first it works, then it doesn't.

   


Thanks for pointing the PPC/x86 divide to me.

I am currently working on a PPC with a view to getting a PPC-compliant 
standalone up-and-running.


Then, and only then, will I take the code over to my Ubuntu box and 
start scratching my head all over again.


sincerely, Richmond Mathewson.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Spaced Out

2010-09-05 Thread Richmond

On 09/05/2010 03:06 PM, Mark Schonewille wrote:

Hi Richmond,

Are you doing this on a PowerPC processor? I think your script will break on a computer 
with x86 processor. In unicode, a space still is space&  NULL on x86 platforms and 
NULL&  space on PPC platforms. Your script seems to find a space on PPC platforms 
but a NULL character on x86 platforms.

--
Best regards,

Mark Schonewille

   


Both you and I were wrong; which from the viewpoint of one lonely, lazy 
Runtine Revolutionary

fighting out his own path to Revolutionary bliss here in Bulgaria . . .

. . . Err . . . wait a minute while I punch myself in the face for that 
outburst . . .  :)


My SPACE detection script is working just fine having ported the stack 
over to the old HP-with-Ubuntu !


Betetr belt off an Intel build for my Beta testers directly from the PPC 
code and see what they have to see

about that (especially as have no Intel Mac lolling around here) . . .
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution