T.R | Title | User | Personal Name | Date | Lines |
---|
3893.1 | I would have thought this never worked? | IOSG::BILSBOROUGH | SWBFS | Thu Feb 17 1994 09:10 | 5 |
|
I thought that fn$locate was used to check if a whole substring was in
a string and not whole substring or partial.
Mike
|
3893.2 | How about ... | IOSG::MAURICE | I left my heart in Alcatraz | Thu Feb 17 1994 11:15 | 10 |
| Hi,
FN$LOCATE returns a number rather than a TRUE/FALSE indicator. I think
your line should be:
.if not (fn$locate("FCPT", #send_choice) eq 0) then ...
Cheers
Stuart
|
3893.3 | I'm staying with fn$member anyway | GANTRY::HULL | Digital Consulting [Delivery]/Motown | Thu Feb 17 1994 19:46 | 17 |
| re: <<< Note 3893.1 by IOSG::BILSBOROUGH "SWBFS" >>>
> -< I would have thought this never worked? >-
> I thought that fn$locate was used to check if a whole substring was in
> a string and not whole substring or partial.
Mike - 'F' **is** a "whole" substring of string 'FTCP' etc. 8^)
Stuart - you're probably right in usage, but nevertheless it worked fine
before the MUPA and now it doesn't. I always thought you could treat any
0/1 value in a T/F boolean.
Regards,
Al
|
3893.4 | | IOSG::CARLIN | Dick Carlin IOSG, Reading, England | Fri Feb 18 1994 19:29 | 12 |
| Al
Even though it should have been coded differently (as Stuart pointed
out) I am still bothered if your original fn$locate code is working in
V3 but failing in MUPA since the code for lexicals didn't get changed.
Since the (undocumented?) .IF rules are that 0=false and non-0=true you
should be ok.
I tried it on a MUPA system here and it seemed to work ok, how does it
fail for you?
Dick
|
3893.5 | So what changed in V3.0A? | GANTRY::HULL | Digital Consulting [Delivery]/Motown | Mon Feb 21 1994 15:54 | 58 |
| Dick -
Here's a short test version of the problem code. It works fine on V3.0 and
V3.0-1, but fails to recognise the 'match' of the substring when running
under V3.0A. I shortened the promt text just to fit the screen better.
.label start
prompt "Send (F)ull listing, or (T)ext file: "\oa$fld_stay
.if oa$prompt_dispose ne 2 then .exit
get #send_choice = FN$UPPER(oa$prompt_text)
.if not (fn$locate("FCPT", #send_choice)) then .goto start
.exit
Here's the failing trace (I entered lowercase f as the response):
![SCRIPT] P Line 1: .label start
![SCRIPT] P Line 2: prompt "Send (F)ull listing, or (T)ext file:
"\oa$fld_stay
![FUNC] Function: PROMPT, Cmd line: "Send (F)ull listing, or (T)ext file:
"
![SYMBOL] Symbol: "Send (F)ull listing, or (T)ext file: ", Value: Send
(F)ull li
! sting, or (T)ext file:
![FUNC] Function: OA$FLD_DONE, Cmd line:
![FUNC] Function: OA$FLD_STAY, Cmd line:
![SCRIPT] P Line 3: .if oa$prompt_dispose ne 2 then .exit
![SYMBOL] Symbol: OA$PROMPT_DISPOSE, Value: 2
![SYMBOL] Symbol: 2, Value: 2
![SCRIPT] IF Operation starting
![SCRIPT] .IF condition OA$PROMPT_DISPOSE NE 2 is FALSE
![SCRIPT] Null ELSE clause detected
![SCRIPT] P Line 4: get #send_choice = FN$UPPER(oa$prompt_text)
![FUNC] Function: GET, Cmd line: #send_choice = FN$UPPER(oa$prompt_text)
![SYMBOL] Symbol: oa$prompt_text, Value: f
!
!
!
!
![SYMBOL] Symbol: #send_choice = FN$UPPER(oa$prompt_text), Value: F
!
!
!
![SCRIPT] P Line 5: .if not (fn$locate("FCPT", #send_choice)) then .goto
start
![SYMBOL] Symbol: "FCPT", Value: FCPT
![SYMBOL] Symbol: #SEND_CHOICE, Value: F
!
!
!
!
![SYMBOL] Symbol: FN$LOCATE("FCPT", #SEND_CHOICE), Value: 0
![SCRIPT] IF Operation starting
![SCRIPT] .IF condition NOT (FN$LOCATE("FCPT", #SEND_CHOICE)) is TRUE
![SCRIPT] THEN Operation starting
![SCRIPT] P Line 5: .goto start
![SCRIPT] P Line 2: prompt "Send (F)ull listing, or (T)ext file:
"\oa$fld_stay
endless prompt loop since F or T fails to be a match...
|
3893.6 | Here's a V3.0 (success) trace of the same | GANTRY::HULL | Digital Consulting [Delivery]/Motown | Mon Feb 21 1994 16:01 | 14 |
| And here's the same code run on a V3.0 (unpatched) system. As can be seen,
the FN$LOCATE returns a '1' (success/true) which failed under V3.0A.
Go figure...
![SCRIPT] P Line 5: .if not (fn$locate("FCPT", #send_choice)) then .goto
start
![SYMBOL] Symbol: "FCPT", Value: FCPT
![SYMBOL] Symbol: #SEND_CHOICE, Value: F
![SYMBOL] Symbol: FN$LOCATE("FCPT", #SEND_CHOICE), Value: 1 <<<<<<<<<<<<
![SCRIPT] IF Operation starting
![SCRIPT] .IF condition NOT (FN$LOCATE("FCPT", #SEND_CHOICE)) is FALSE
![SCRIPT] Null ELSE clause detected
![SCRIPT] P Line 6: .exit
|
3893.7 | You're right! | IOSG::CARLIN | Dick Carlin IOSG, Reading, England | Tue Feb 22 1994 07:51 | 10 |
| Al
Yes, sorry. I was wrong on most counts in my previous reply. The main
lexicals module did not change, but an ancillary one did, causing the
problem you found (and a couple you did not find). I couldn't reproduce
the problem initially because I tried it out with literal strings
rather than symbol references and they worked okay. Solution will be in
a pfr. Thanks for your patience, things are fairly hectic here.
Dick
|