• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Strange raw code problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Strange raw code problem


  • Subject: Strange raw code problem
  • From: "Serge Belleudy-d'Espinose" <email@hidden>
  • Date: Sun, 18 Nov 2001 09:47:12 +0100

(second try with another address as my previous message didn't show
for more than 24h)

I'm trying to script Network Setup Scripting with raw codes. One line says:

set xActivity to state of xStatus

where state is a constant with values idle/ connecting/ connected/
disconnecting/ unknown. If I check it against idle,

if xActivity is not idle

upon checking SE/Smile add () around idle

if xActivity is not (idle)

and on run NSS says something like "NSS doesn't understand the idle command."
So I tried to coerce the constant to a string and check against a string:

set xActivity to "" & state of xStatus
if xActivity is not "idle"

which works most of the time but not always; from time to time, state
will be coerced to

<<constant ****RAs1>>

wich is the raw code for idle, but if I type the code itself in the
script it is immediately translated to idle, and then the
parenthesis. So my last trick was to check xActivity against both
values:

if xActivity is not in {"idle", "<<constant ****RAs1>>"}

and it seems to always work, but it's really awkward. Of course there
is the fact that idle is also the reserver word for the handler but
still, the code works ok when writen straight w/o raw codes.

I wish someone has an explanation/better idea.

Thanks,


Serge
--
\\//\//\// Serge Belleudy-d'Espinose Institut Jacques Monod
// // // http://www.ijm.jussieu.fr/ Universite Paris VII - Jussieu
//\//\//\\


  • Follow-Ups:
    • Re: Strange raw code problem
      • From: Emmanuel <email@hidden>
  • Prev by Date: Can't program link
  • Next by Date: "original item of" activates Finder!?
  • Previous by thread: Strange raw code problem
  • Next by thread: Re: Strange raw code problem
  • Index(es):
    • Date
    • Thread