Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

getput.txt file

hi,

i'm looking - but can't find anymore- for a text file

written by L.AYERS, that explains how the GET and

PUT statements work in BASIC. could someone help?

thank you beforehand.

tury@cam.org


Comments

  • It's really not that hard. Here:


    First, you'll want to create a place to store your image. Let's call it MYIMAGE.


    DIM MYIMAGE(100)


    Creates a variable called MYIMAGE, that's 100 bytes in length. Meaning, the image is 50x50. Now that we have our image's variable created, we can now create our image. For space purposes, I'll do one that is random:


    screen 13

    for y=1 to 50

    for x=1 to 50

    pset (x,y), int(rnd*255)

    next x

    next y


    That will just create garble in the upperleft hand corner of the screen. Now, let's GET the image, and stuff it into our MYIMAGE variable:


    get (1,1)-(50,50), myimage


    Done. Now, let's display it in a different place:


    PUT (100,100), myimage


    Now, for the whole code, including one minor part I left out(which was randomize timer. It does nothing more than ensure that your garble image will not be the same.) :


    dim myimage(100)

    screen 13

    randomize timer

    rem Create garble image:

    for y=1 to 50

    for x=1 to 50

    pset(x,y),int(rnd*255)

    next x

    next y

    rem Get image, put into memory:

    get (1,1)-(50,50),myimage

    rem Put Image:

    put (100,100),myimage


    We're done.


    Some notes to remember about this, though:


    You can not PUT an image offscreen. If your image is 50x50, and you try to put it at 320x200 in screen 13, it won't work. If you require something like this, it's best to do a 2D array, and read in the values from a seperate text file.


    Got more questions? Go ahead and ask. That's what the board's here for. If you need further explaination, just request it.


  • : hi,

    : i'm looking - but can't find anymore- for a text file

    : written by L.AYERS, that explains how the GET and

    : PUT statements work in BASIC. could someone help?

    : thank you beforehand.

    : tury@cam.org


    i CAN TRY AND MAKE UP A FILE TELLING YOU HOW TO DO IT

    THAT EXPLAINS IT THEN I WILL SEND IT TO YOU IF I CAN!


Sign In or Register to comment.