Groups > Superbase > Superbase NG > Re: Was: fsfileinputstream Now: something else




fsfileinputstream

fsfileinputstream
Mon, 21 Apr 2008 11:45:43 -040
I'm sure that I don't quite understand all of the parameters for 
fsfileinputstream.  I'm sure that this has probably already been built
by you guys internally (if not why not?) but I'm playing around with 
reading SB2 files as a prelude to reading them into (importing them 
into)a SBM or PPCS.

I've read the documentation, but I'm dense. It might make sense also for 
me to be using .getblob instead of getstring.  I think if I saw code for 
reading SB2 file into a SBM I'd better understand it. I'm not sure I 
REALLY understand anything but the length parameter.


In playing around there is a tiny feature/bug with looking at the arrays 
in the variables. You can't really "directly" inspect and/or change
the 
value of an array element.  You can look at the element but there is 
really a length limit, if you use the commented lines instead of the 
current active lines (i.e., use segment=1 and make the element size
grow exponentially) you'll see the problem.  There is no way to make the 
window/column big enough to look at a really long array element.

function main()
   fsfileinputstream f
   array a
   string test, test2
   integer length,length2,segment,i
   integer charsize
   boolean lbo
   string terminator
   string terminatedby

   length = 50000
   charsize = 1
   lbo = .true
   terminator = "@"
   terminatedby = .nul
   a =@ array.new()

   f =@ fsfileinputstream.new("C:\SB4W\SBNGTEST.SBF")
   test2 = f.getstring (length, charsize, lbo, terminator, terminatedby)
   test = f.getstring (length, charsize, lbo, "?", terminatedby)
   length2 = .len(test)
   //segment = 1
   segment = 20
   i = 0
   while i < length2
   //a[i]= .substr(test,i,segment*i)
   a[i]= .substr(test,i,segment)
   a[i,i] = .charval(a[i])
   i = i+1
   end while
Post Reply
Re: fsfileinputstream
Tue, 22 Apr 2008 10:12:57 +010
Kromkowski wrote:
> I'm sure that I don't quite understand all of the parameters for 
> fsfileinputstream.  I'm sure that this has probably already been built
> by you guys internally (if not why not?) but I'm playing around with 
> reading SB2 files as a prelude to reading them into (importing them 
> into)a SBM or PPCS.

Actually, I have built a tool to convert SBFs to SBMs. I will include it 
in the next release. Reading SBFs is a non-trivial exercise, since you 
have to also deal with things like potentially random access within the 
file (not supported by file streams). You also would need to have an 
IEEE library for converting from floating point values to number. You 
also need to cope with date values as integers and adjust them to the 
correct value for SIMPOL, etc., etc.

> I've read the documentation, but I'm dense. It might make sense also for 
> me to be using .getblob instead of getstring.  I think if I saw code for 
> reading SB2 file into a SBM I'd better understand it. I'm not sure I 
> REALLY understand anything but the length parameter.

I actually wrote a library that does the whole thing in a very 
object-oriented way. It also parses the SBD file.

> In playing around there is a tiny feature/bug with looking at the arrays 
> in the variables. You can't really "directly" inspect and/or
change the 
> value of an array element.  You can look at the element but there is 
> really a length limit, if you use the commented lines instead of the 
> current active lines (i.e., use segment=1 and make the element size
> grow exponentially) you'll see the problem.  There is no way to make the 
> window/column big enough to look at a really long array element.

You are quite right, it isn't possible to change the value in the 
debugger, but in most cases it should be enough to at least see the 
value. Eventually we may add the ability to change it, but not right away.

As for values that get too long, this is a known limitation of the IDE, 
since it is conceivable that a given variable could contain far more 
information than is reasonable to show. When we rewrite the IDE in 
SIMPOL, we will address this issue as well.

Post Reply
Was: fsfileinputstream Now: something else
Tue, 22 Apr 2008 12:43:08 -040
Neil Robinson wrote:
> Kromkowski wrote:
>> I'm sure that I don't quite understand all of the parameters for 
>> fsfileinputstream.  I'm sure that this has probably already been built
>> by you guys internally (if not why not?) but I'm playing around with 
>> reading SB2 files as a prelude to reading them into (importing them 
>> into)a SBM or PPCS.
> 
> Actually, I have built a tool to convert SBFs to SBMs. I will include it 
> in the next release. 

Which will be when?

> When we rewrite the IDE in 
> SIMPOL, we will address this issue as well.

The looming rewrite of the IDE in SIMPOL -- Is that going to happen 
before or after "this product" - is actually something that can in a
RAD 
way create basic kinds of applications, that we've become accustomed to 
creating in SB2 and SB3?  You know, with things, like reports and detail 
blocks, -- your basic Superbase Airlines Demo kind of thing.
Post Reply
Re: Was: fsfileinputstream Now: something else
Wed, 23 Apr 2008 12:15:35 +010
Kromkowski wrote:
> Neil Robinson wrote:
>> Kromkowski wrote:
>>> I'm sure that I don't quite understand all of the parameters for 
>>> fsfileinputstream.  I'm sure that this has probably already been
built
>>> by you guys internally (if not why not?) but I'm playing around
with 
>>> reading SB2 files as a prelude to reading them into (importing them

>>> into)a SBM or PPCS.
>>
>> Actually, I have built a tool to convert SBFs to SBMs. I will include 
>> it in the next release. 
> 
> Which will be when?

Soon.

>> When we rewrite the IDE in SIMPOL, we will address this issue as well.
> 
> The looming rewrite of the IDE in SIMPOL -- Is that going to happen 
> before or after "this product" - is actually something that can
in a RAD 
> way create basic kinds of applications, that we've become accustomed to 
> creating in SB2 and SB3?  You know, with things, like reports and detail 
> blocks, -- your basic Superbase Airlines Demo kind of thing.

The IDE rewrite is not scheduled until v2 in 2009.

I am trying to put data-aware grids in the next release, along with a 
bunch of other functionality. In the release after we should have the 
detail blocks, report front-end, and print form designer.

Post Reply
about | contact