Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: (12) lines 'locks up' Rebol view ??
Pages: [1] Print
Author Topic: (12) lines 'locks up' Rebol view ??  (Read 1225 times)
jfdutcher
Jr. Member
**
Offline Offline

Posts: 95


View Profile
(12) lines 'locks up' Rebol view ??
« on: March 03, 2006, 12:28:50 PM »

Does anyone see why the code below should 'hang' View ?  Cannot 'Quit' it or get a response. Other Win 2000
apps continue to function. This brief code worked fine before I added the for loop ....when it was a straight-thru
request for just one record's data.

Code:
Rebol[Title: "Sort dsysmst.txt to name sequence"]

port: open/binary/seek %/c/vetssrc/dietsys/dsysmst.txt

read-record: func [port record-size record-number] [
   copy/part at port record-number - 1 * record-size + 1   record-size
]

substr: func [record offset len] [
   copy/part at record offset len
]

for i 1 10 1 [
   rec1: to-string read-record port 2690 i
   regnbr:  substr rec1 3 4
   lname:   substr rec1 7 15
   fname:   substr rec1 22 15
   minit:     substr rec1 37 1
   print [regnbr lname fname minit]
]

halt    
Logged
jfdutcher
Jr. Member
**
Offline Offline

Posts: 95


View Profile
(12) lines 'locks up' Rebol view ??
« Reply #1 on: March 03, 2006, 12:34:14 PM »

This just shows how bad some of us can be.....
After starting to close apps that were open on the desktop....I started seeing the 'little'  alert boxes wanting to know about permission to open a file on the desktop....they were hidden ....behind other windows.

I wasn't expecting that issue to arise.... just to do a 'print' exercise,   but I guess it does.

John D.  
Logged
jfdutcher
Jr. Member
**
Offline Offline

Posts: 95


View Profile
(12) lines 'locks up' Rebol view ??
« Reply #2 on: March 03, 2006, 12:43:55 PM »

I will observe that now that I am seeing the printed results ....there seems to be an 'anomoly'  in the
second field in each print line; they have a 'digit' in front of the actual field value ..... hence

1524   2Hornbeck       Edna  
2466   7Badger           Donald
3545   7Economou     Thomas

The digit before last name is not part of the value retrieved from the file record .......wonder where it came from ??
Logged
jfdutcher
Jr. Member
**
Offline Offline

Posts: 95


View Profile
(12) lines 'locks up' Rebol view ??
« Reply #3 on: March 03, 2006, 12:50:19 PM »

Thank the Lord not too many people read these....

The digit is the last piece of the 'first' field......

Clearly some kind of offset problem 'I' have.......
but then, you knew that ..........


J.D.
Logged
jfdutcher
Jr. Member
**
Offline Offline

Posts: 95


View Profile
(12) lines 'locks up' Rebol view ??
« Reply #4 on: March 03, 2006, 12:55:23 PM »

Well, maybe it's not 'all' me....

Clearly it is including the value of 'i'  (from the for loop)
or inserting the record number value from the file....
(the 1st (10) would be records 1-10.

I'm not including record # in the 'print' request block...
so don't expect to see either it....or the value of  'i'  Huh
Logged
jfdutcher
Jr. Member
**
Offline Offline

Posts: 95


View Profile
(12) lines 'locks up' Rebol view ??
« Reply #5 on: March 03, 2006, 01:10:09 PM »

After this ...no more  bull posted...

But it seems as though something is not right for if
I just set a single field equal to the 1st 38 bytes from the
records read   and then print it as 'substr  0  38'
the result is as it should be.

Since 'regnbr'  starts  in physical position (4)  and the 1st position is (apparently)  zero ('0')  then the value of
'substr 3   4 '   ought to be the regnbr.

i.e  The 1st record on the file is:
        '0015342HORNBECK     EDNA'
the next is:
        '0024667BADGER          DONALD'

but I have to use   'substr   4  4' to get it

similarly  'lname'  should be 'substr  7   15'
but I have to use  'subtsr  8   15'

??  
         
   
Logged
jfdutcher
Jr. Member
**
Offline Offline

Posts: 95


View Profile
(12) lines 'locks up' Rebol view ??
« Reply #6 on: March 03, 2006, 01:27:39 PM »

It's not possible .....but it is....

If I use the values :
Code:
 
    lname: substr rec1  8   15
    fname: substr rec1  22 15
    minit:   substr rec1  37  1

I get exactly the same results as using:
Code:
   

     lname:   substr   rec1   8   15
     fname:   substr   rec1   23 15
     minit:     substr   rec1   38 1


??
   
Logged
jfdutcher
Jr. Member
**
Offline Offline

Posts: 95


View Profile
(12) lines 'locks up' Rebol view ??
« Reply #7 on: March 03, 2006, 01:47:25 PM »

The upshot is ......how can 'different'  offset values
directed to the same physical file record deliver the 'same'
resultant variable results  ......  doesn't seem 'right' to me !
Logged
Brock
Newbie
*
Offline Offline

Posts: 14


View Profile
Re: (12) lines 'locks up' Rebol view ??
« Reply #8 on: April 26, 2006, 04:14:51 PM »

Did you figure this out?!?

My thoughts are to look in the substr function you are using for your answer as this is not a Rebol word.
Logged
Thør
Newbie
*
Offline Offline

Posts: 46


View Profile
Re: (12) lines 'locks up' Rebol view ??
« Reply #9 on: June 21, 2006, 01:34:05 PM »

Could you perhaps give us the structure, or maybe even an actual line/record from your input file? That would help a lot, me thinks.

Cheers!
Logged
Pages: [1] Print 
Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: (12) lines 'locks up' Rebol view ??
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 04, 2008, 12:20:43 AM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2315 Posts in 597 Topics by 4206 Members
Latest Member: amoutbroodo

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc