Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Free basic: problem resizing 2d array of pointers to objects ?!?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 26 - 32 of 32 - Collapse all  -  Translate all to Translated (View all originals) < Older 
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Skybuck Flying  
View profile  
 More options Sep 6 2009, 4:46 am
Newsgroups: alt.comp.lang.borland-delphi, comp.arch, rec.games.corewar
From: "Skybuck Flying" <BloodySh...@hotmail.com>
Date: Sun, 6 Sep 2009 10:46:53 +0200
Local: Sun, Sep 6 2009 4:46 am
Subject: Re: Free basic: problem resizing 2d array of pointers to objects ?!?
Adding byref doesn't seem to help...

My guess is... free basic still a bit buggy ! ;)

I am hoping the ReadFromStream function continues to work otherwise I am
gonna get a bit pissed off ;) :)

I am not gonna release any code if it's not working ! :) :( :) :( :) ;)

Bye,
  Skybuck.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Skybuck Flying  
View profile  
 More options Sep 6 2009, 5:05 am
Newsgroups: alt.comp.lang.borland-delphi, comp.arch, rec.games.corewar
From: "Skybuck Flying" <BloodySh...@hotmail.com>
Date: Sun, 6 Sep 2009 11:05:57 +0200
Local: Sun, Sep 6 2009 5:05 am
Subject: Re: Free basic: problem resizing 2d array of pointers to objects ?!?
Nope it wasn't a bug in free basic... well maybe sort of it was... hehehehe.

Free basic is designed a bit weird...

get and put parameters are a bit weird and inconsistent... but it's ok... I
finally figured it out...

Ammount means "number of variables" and not "number of bytes"...

So all I need to do to make the read integer function work is set ammount to
1 to read one integer.. otherwise a buffer overrun would probably occur !
(Good thing windows has memory protection ! ;) It warned many times...)

Now the issue should be fixed here is full code with examples for read
functions:

(Now I should be done in a snap... no fixing required for my code so that's
cool... )

I was beginning to loose faith in freebasic.... but it appears to work.

So far there are a couple of things that I find instatisfactory:

1. if...then,  the "then" is not needed and could be scrapped from the
language, or made optional that would code most more pleasantly.

2. get/put functions weird.

3. no debugger... but in a way... having no debugger is kinda interesting...
this forces me to read the documentation over and over until I find the
solution... with a debugger I might have been wasting more time try to
figure out what's going on ! LOL ;) :)

rem *** start of code ***:

const false = 0
const true = 1

function ReadByteFromStream( ParaStream as integer, byref ParaByte as byte )
as integer

    dim vBytesRead as integer

    get #ParaStream, ,ParaByte, 1, vBytesRead

    if vBytesRead = SizeOf(byte) then return true

    return false

end function

function ReadShortFromStream( ParaStream as integer, byref ParaShort as
short ) as integer

    dim vBytesRead as integer

    get #ParaStream, ,ParaShort, 1, vBytesRead

    if vBytesRead = SizeOf(short) then return true

    return false

end function

function ReadIntegerFromStream( ParaStream as integer, byref ParaInteger as
integer ) as integer

    dim vBytesRead as integer

    get #ParaStream, ,ParaInteger, 1, vBytesRead

    if vBytesRead = SizeOf(integer) then return true

    return false

end function

function ReadLongintFromStream( ParaStream as integer, byref ParaLongint as
longint ) as integer

    dim vBytesRead as integer

    get #ParaStream, ,ParaLongint, 1, vBytesRead

    if vBytesRead = SizeOf(longint) then return true

    return false

end function

function ReadFromStream( ParaStream as integer, ParaBuffer as any ptr,
ParaSize as integer ) as integer

    dim vBytesRead as integer

    get #ParaStream, ,*CPtr( byte ptr, ParaBuffer ), ParaSize, vBytesRead

    return vBytesRead
end function

sub main

dim vLongint as longint
dim vInteger as integer
dim vWord as short
dim vByte as byte

dim vFileStream as integer

rem find first free file handle
vFileStream = freefile

rem open "test.dat" as binary filestream
open "test.dat" for binary as #vFileStream

    dim vBytesRead as integer

if true = false then
    Seek vFileStream, 1

    vBytesRead = ReadFromStream( vFileStream, @vLongint, SizeOf(longint) )
    print using "bytes read: ## value: ##################"; vBytesRead,
vLongint

    vBytesRead = ReadFromStream( vFileStream, @vInteger, SizeOf(integer) )
    print using "bytes read: ## value: ###############"; vBytesRead,
vInteger

    vBytesRead = ReadFromStream( vFileStream, @vWord, SizeOf(ushort) )
    print using "bytes read: ## value: ###########"; vBytesRead, vWord

    vBytesRead = ReadFromStream( vFileStream, @vByte, SizeOf(ubyte) )
    print using "bytes read: ## value: #####"; vBytesRead, vByte

    sleep

    seek vFileStream, 1

endif

    if ReadLongintFromStream( vFileStream, vLongint ) = true then
        print using "longint read: ###################"; vLongint
    endif

    if (ReadIntegerFromStream( vFileStream, vInteger ) = true) then
        print using "integer read: ##########"; vInteger
    endif

    if (ReadShortFromStream( vFileStream, vWord ) = true) then
        print using "word read: #####"; vWord
    endif

    if (ReadByteFromStream( vFileStream, vByte ) = true) then
        print using "byte read: ###"; vByte
    endif

    rem extra parenthesis don't matter ;)
    if (ReadLongintFromStream( vFileStream, vLongint ) = true) then
        print using "longint read: ###################"; vLongint
    endif

    if (ReadIntegerFromStream( vFileStream, vInteger ) = true) then
        print using "integer read: ##########"; vInteger
    endif

    if ReadShortFromStream( vFileStream, vWord ) = true then
        print using "word read: #####"; vWord
    endif

    if ReadByteFromStream( vFileStream, vByte ) = true then
        print using "byte read: ###"; vByte
    endif

rem close binary filestream
close #vFileStream

end sub

main

print "press enter to terminate"

rem wait for a key press
sleep

rem *** end of code ***

Bye,
  Skybuck.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Skybuck Flying  
View profile  
 More options Sep 6 2009, 5:17 am
Newsgroups: alt.comp.lang.borland-delphi, comp.arch, rec.games.corewar
From: "Skybuck Flying" <BloodySh...@hotmail.com>
Date: Sun, 6 Sep 2009 11:17:25 +0200
Local: Sun, Sep 6 2009 5:17 am
Subject: Re: Free basic: problem resizing 2d array of pointers to objects ?!?
Also editor doesn't work so fast, things missing:

1. Replace all for selected text

2. Quickly delete spaces/lines.

But ok so far so good...

(Also it asks stupid questions:)

3. Do you want to save ?

4. Do you want to use new file ?

^ Get rid of that ;) (but I can't no options for it ! ;))

Bye,
  Skybuck.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Skybuck Flying  
View profile  
 More options Sep 6 2009, 5:37 am
Newsgroups: alt.comp.lang.borland-delphi, comp.arch, rec.games.corewar
From: "Skybuck Flying" <BloodySh...@hotmail.com>
Date: Sun, 6 Sep 2009 11:37:10 +0200
Local: Sun, Sep 6 2009 5:37 am
Subject: Re: Free basic: problem resizing 2d array of pointers to objects ?!?
Hmm it appears that somehow a serious mistake has slipped into the
specification.

I just checked loading a battlefield.dat in Delphi.

Apperently booleans in Delphi are 1 byte...

Last time I checked it was 4 bytes ?!?

Very strange !

Hmm...

Bye,
  Skybuck.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Skybuck Flying  
View profile  
 More options Sep 8 2009, 10:36 am
Newsgroups: alt.comp.lang.borland-delphi, comp.arch, rec.games.corewar
From: "Skybuck Flying" <BloodySh...@hotmail.com>
Date: Tue, 8 Sep 2009 16:36:47 +0200
Local: Tues, Sep 8 2009 10:36 am
Subject: Re: Free basic: problem resizing 2d array of pointers to objects ?!?
See my skydrive for updated executables, specifications and source code
examples ! ;)

http://cid-aedd0ea32d61bc86.skydrive.live.com/home.aspx

Bye,
  Skybuck.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "I am beginning to understand a possible future of computing ;)" by Tim McCaffrey
Tim McCaffrey  
View profile  
 More options Sep 9 2009, 2:06 pm
Newsgroups: alt.comp.lang.borland-delphi, comp.arch, rec.games.corewar
From: timcaff...@aol.com (Tim McCaffrey)
Date: Wed, 9 Sep 2009 18:06:27 +0000 (UTC)
Local: Wed, Sep 9 2009 2:06 pm
Subject: Re: I am beginning to understand a possible future of computing ;)
In article
<c424cec1-a124-486d-8f13-b7f42add3...@m38g2000yqd.googlegroups.com>,
MitchAl...@aol.com says...

>To a first order, you have just rediscovered the capabilities machine
>architecture. Used in the ICL 2900, M5, Bouroughs B5000 and B6000
>series computers. This computation style fell out of favor in the
>early 1980s for a variety of reasons. These machines were adapt at
>doing things like computing ALGOL parameter 'thunks', and some LISP
>stuff. Had they not made the mistake of placing too much of the
>security, rights and protection mechanisms in the 'cell.ID' they would
>have probably gone farther.

Well, the Burroughs B5000/6000 should have gone further, but its not dead.

See Unisys MCP systems (Currently called Clearpath Libra).

                - Tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
MitchAlsup  
View profile  
 More options Sep 9 2009, 4:46 pm
Newsgroups: alt.comp.lang.borland-delphi, comp.arch, rec.games.corewar
From: MitchAlsup <MitchAl...@aol.com>
Date: Wed, 9 Sep 2009 13:46:09 -0700 (PDT)
Local: Wed, Sep 9 2009 4:46 pm
Subject: Re: I am beginning to understand a possible future of computing ;)
On Sep 9, 1:06 pm, timcaff...@aol.com (Tim McCaffrey) wrote:

I am aware of that, SkyBusk is obviously not.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages < Older 
« Back to Discussions « Newer topic     Older topic »