Trouble with arrays, lookup


+ Reply to Thread
Results 1 to 14 of 14

Thread: Trouble with arrays, lookup951 days old

  1. #1
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,412
    Thumbs Up
    Received: 48
    Given: 40
    Total Downloaded
    3.45 GB

    0 Not allowed!

    Default Trouble with arrays, lookup

    I'm going nuts. Will somebody please tell me what I'm doing wrong here:

    Dim ASCII[32] As Byte = "0", "1", "2", "3", "4", "5"
    Dim Telec[32] As Byte = 16, 1, 2, 19, 4, 21
    Dim indx As Word

    For indx = 0 To 5
    HRSOut Dec indx, " ", Dec ASCII[indx], " ", Dec Telec[indx], "\r\n"
    Next
    Stop

    It prints:
    0 0 0
    1 0 0
    2 0 0
    3 0 0
    4 0 0
    5 0 0

    Chip is 24HJ128GP502 compiler 1.0.2.1

    I've tried LOOKUP and get similar results. Perhaps I have just passed the age of "being able to write code"

    Charlie

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Prolific Poster John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,887
    Thumbs Up
    Received: 91
    Given: 34
    Total Downloaded
    4.60 GB

    1 Not allowed!

    Default Re: Trouble with arrays, lookup

    G'day Charlie
    Just as a diagnostic have you tried reducing the size of your array to 6?
    Alternatively, completely filling the array during the declaration.
    I'm guessing it might be to do with the declaration side of things.
    John

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,412
    Thumbs Up
    Received: 48
    Given: 40
    Total Downloaded
    3.45 GB

    1 Not allowed!

    Default Re: Trouble with arrays, lookup

    G'day John

    Good idea, I'll try it. Thanks.

    Charlie

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,592
    Thumbs Up
    Received: 339
    Given: 162
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: Trouble with arrays, lookup

    I've just tried the above code and I get the correct values displayed in the serial terminal Charlie.

    0 48 16
    1 49 1
    2 50 2
    3 51 19
    4 52 4
    5 53 21

    Version 1.0.2.1 of the Proton24 compiler is quite old Charlie. Update to the latest version.

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #5
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,412
    Thumbs Up
    Received: 48
    Given: 40
    Total Downloaded
    3.45 GB

    0 Not allowed!

    Default Re: Trouble with arrays, lookup

    Les

    I downloaded the "latest" version: 3.6.0.2 but once installed, if I click on "About" it says 3.6.0. 2 1.0.2.1
    Yet the file in Downloads is called: Proton Compiler Setup 3.6.0.2_1.0.4.4

    It appears that I have updated the ordinary Proton, but not P24? Sorry but I am a bit lost now?

    Correction: the version reported in "About" is wrong. If I look in the assembler listing then it says 1.0.4.4,
    so this is the version that failed for me.

    Was your test on the simulator?

    Charlie
    Last edited by charliecoultas; 23rd October 2017 at 19:54.

  10. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  11. #6
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,412
    Thumbs Up
    Received: 48
    Given: 40
    Total Downloaded
    3.45 GB

    0 Not allowed!

    Default Re: Trouble with arrays, lookup

    Well that's mighty odd! I just tried it again and it works. I'll investigate further, somehow?

    Charlie

    Thanks for looking at this Les, sorry if it's a red herring.

  12. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  13. #7
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,412
    Thumbs Up
    Received: 48
    Given: 40
    Total Downloaded
    3.45 GB

    1 Not allowed!

    Default Re: Trouble with arrays, lookup

    A slight case of red-face here. If I define an array, an fill it with data as part of the Dim structure, then issue a Clear instruction, I image that it will clear the array?

    Doh! Perhaps i should turn my hand to kitchen fitting instead?

    By the way, my Elliott 803 emulator is now working pretty well. I have a few issues with floating point but I'm getting there (your 64 bit IEEE code works a treat Les).
    The BlueTooth link to an external tablet means that there are virtually no wires to the emulator board apart from +9V ground and two loudspeaker wires.

    Charlie

    Last edited by charliecoultas; 23rd October 2017 at 20:18.

  14. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  15. #8
    Prolific Poster John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,887
    Thumbs Up
    Received: 91
    Given: 34
    Total Downloaded
    4.60 GB

    0 Not allowed!

    Default Re: Trouble with arrays, lookup

    Good work Charlie, You wouldn't be alone in making mistakes. Under water knitting is another option if you ever give up programming, although the sharks down here make it more hazardous.
    John

  16. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  17. #9
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,592
    Thumbs Up
    Received: 339
    Given: 162
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: Trouble with arrays, lookup

    I'll check out the code version and make sure it complies. It is in several places within the compiler, and also the C++ compiler that generates the compiler. I always go by the asm listing for the version, as this is always bang up to date.

    Yes. The Clear command will clear all RAM, and when an array is filled when it is created, the data is still held in RAM.

  18. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  19. #10
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,412
    Thumbs Up
    Received: 48
    Given: 40
    Total Downloaded
    3.45 GB

    0 Not allowed!

    Default Re: Trouble with arrays, lookup

    Cheers Les. This is my emulator:

    Spot the mistake....

    Click image for larger version

Name:	Capture.JPG
Views:	26
Size:	38.9 KB
ID:	3371

  20. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  21. #11
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,353
    Thumbs Up
    Received: 83
    Given: 183
    Total Downloaded
    5.30 GB

    0 Not allowed!

    Default Re: Trouble with arrays, lookup

    Spot the mistake
    It's the big black blob.
    George.

  22. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  23. #12
    Prolific Poster johngb's Avatar
    Join Date
    Oct 2003
    Posts
    2,177
    Thumbs Up
    Received: 97
    Given: 1
    Total Downloaded
    2.91 GB

    0 Not allowed!

    Default Re: Trouble with arrays, lookup

    I can see this board alongside the original Elliott 802 racks. What a contrast.
    JohnB

  24. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  25. #13
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,412
    Thumbs Up
    Received: 48
    Given: 40
    Total Downloaded
    3.45 GB

    0 Not allowed!

    Default Re: Trouble with arrays, lookup

    That was the idea John. The board will be part of a little scale model of the 803 machine, sitting on top of the actual 803, to emphasize the huge difference in scale.
    The emulator will be displaying sine/cosine tables and playing music. At the National Museum of Computing: tnmoc.org

    Charlie

  26. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  27. #14
    Prolific Poster johngb's Avatar
    Join Date
    Oct 2003
    Posts
    2,177
    Thumbs Up
    Received: 97
    Given: 1
    Total Downloaded
    2.91 GB

    1 Not allowed!

    Default Re: Trouble with arrays, lookup

    I have been there but it was only open that day for Colossus. Didn't get to see the other machines.
    Next time I go I will try and look you up.
    JohnB

  28. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Question about Lookup
    By C_Moore in forum Proton Plus Compiler v3
    Replies: 20
    Last Post: 17th July 2008, 01:16
  2. what's best way for a 5k lookup table?
    By picyerknows in forum Proton Plus Compiler v3
    Replies: 11
    Last Post: 8th August 2007, 17:09
  3. Trouble with arrays
    By RGV250 in forum Proton Plus Compiler v3
    Replies: 1
    Last Post: 11th July 2007, 08:48
  4. [SOLVED !] lookup question
    By BenBarber in forum Proton Plus Compiler v3
    Replies: 1
    Last Post: 9th August 2005, 00:07
  5. [SOLVED !] fast init of arrays--constant arrays?
    By cgriffin in forum Proton Plus Compiler v3
    Replies: 2
    Last Post: 7th March 2005, 21:50

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts