Author Topic: Problem with Restoring Data Reading.  (Read 3532 times)

0 Members and 1 Guest are viewing this topic.

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Problem with Restoring Data Reading.
« on: May 09, 2006 »
Just looked in the FB Help about using Data statements with in programs.
And am having big problems with using the Restore command to recognize any data labels ( so that it starts at the appropriate data )

Code: [Select]
'
' Data Example Code.
'

Option Explicit
Option Static


Dim A

Dim Cupboard(14)

Restore Dat1

For A=0 to 14

      Read Cupboard(A)

Next

Dat1:
Data -2,-2,0,-1,-2,0,0,-2,0,1,-2,0,2,-2,0

Dat2:
Data 1,2,3,4,5,6,7,8,9,10,11,12,13,14


Any suggestions whats up with Restore and data labels much appreciated.

Cheers,
Clyde.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Stonemonkey

  • Pentium
  • *****
  • Posts: 1315
  • Karma: 96
    • View Profile
Re: Problem with Restoring Data Reading.
« Reply #1 on: May 09, 2006 »
Hi Clyde, that example seem to work ok for me, but if i were to read data inside a sub or function i have some problems unless the data restore label is before the sub/function.
Maybe try placing your data at the start of your code or in an included file.

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Problem with Restoring Data Reading.
« Reply #2 on: May 09, 2006 »
Ok, Cheers I'll try that out.

Big Thanks,
Clyde.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Problem with Restoring Data Reading.
« Reply #3 on: May 09, 2006 »
That did that trick and yep dude, I was having the same probs as you, with using restore in a sub / func.
Sticking the data and labels before any subs/func's works fantastico. Bit odd, that no ones picked it up over in FBNet world.

Cheers,
Clyde
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won: