Wrapping code


Closed Thread
Results 1 to 14 of 14

Thread: Wrapping code

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Wrapping code

    Compiling that code ... generates a "FATAL ERROR: Internal: Locate could not find nCmd = 32174784"

    But it has nothing to do with "Line Continuation" and the "_" underscore.
    There are simply too many characters in the HSEROUT command.

    If you break that into 2 HSEROUT statements, it compiles fine ...
    Code:
    HSEROUT ["iVBORw0KGgoAAAANSUhEUgAAACEAAAAkCAYAAAAHKVPcAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAArtSURBVFhHVVhpb1XXFfVfaACPb579bGYwHvBsP9vPfp6NzGDjCcJghkClpKSIUmVom1aKKqVRUtqilhZwmANUplUSNUOhqIRIQYKUqimhUMKPWF1rn3fd5MN9w7nn7",_
    "nHttfe5BQFfCXylhSgrWYIyfgf1n79DZYV2+UsWI+Avht9XjJLixQj5eb+siFehffvzv/Ws31dke7Wu/wFeYe3ht3TovtbtHuXpW3sL7AEK9Ba8Db5SGsKNft2jUd8U4hkdpkFSYJcMpqxSGi0Dy/i81oNU7CvV+hJTrHvOGN6XgVwrcMp58cay8ti3LBzMtlJA3hgKichT/tcV5jNBKvxpf9Z+",_
    "B3hfUXMRXIKgKXGetjfWIhQopTOLbe3F2RkXzXxUCmThkf07EeYm"]
    
    HSEROUT ["GRMOliHIkAZpYUCecnOYys/um8KpTAPme1pweO1yRIsW4RdVK/GnjhacymUQ4f+/",_
    "PjeO8z2NmG9bjxNtDWaY5CmFumSAIqNIRLgeDpaafEaCG2lAeSyE8kTYLD5MS20tGbHNIVp8elMvHk0P4el4H25PDuBMWx2ut9fjK659NDOKBPFyqa0WD2cG8HhzD66PdOP1nZNmRJqyo6EyRlnKS1FBueXxsMmW4wWyyuW7GCEuet4LYHYpBQzjq001+HQgi/sbe3FxpBMJGn+hdT1uTg/",_
    "XibVX6mVPtMoHvzotJcMCrfzp2Bbp97K+POKB7WvEOxPa9oc9//AEEBNtPX0IZcAAAAAElFTkSuQmCC",34,"/>"]
    If you add a single character to the first HSEROUT ... it will fail.
    Because there are already 512 characters. Apparently, the maximum it can handle.
    DT

  2. #2
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default Re: Wrapping code

    If you break that into 2 HSEROUT statements, it compiles fine ...
    I know. That's what I've been doing but now it's becoming a problem because there are so many HSEROUT statements. A 2kB image takes up 17kB of code space. Is there a better way to send an image that doesn't take up so much code space with HSEROUT statements?

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Wrapping code

    Quote Originally Posted by Christopher4187 View Post
    I know.
    Really!

    ... it's becoming a problem because there are so many HSEROUT statements.
    You could have an HSEROUT statement for every character, and it wouldn't use a single word more than putting everything in a single HSEROUT.
    That's just the way HSEROUT works.
    It calls a macro for each character, it doesn't matter which HSEROUT statement calls the macro.

    A 2kB image takes up 17kB of code space. Is there a better way to send an image that doesn't take up so much code space with HSEROUT statements?
    Store it in FLASH ... a 2kB image will use 2kB (on 18Fs).
    Read it back with READCODE.
    DT

Similar Threads

  1. Working code but my layman approach uses too much code space
    By Christopher4187 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 14th December 2012, 20:44
  2. Code: Why is this code greater than 2000 words?
    By DrDreas in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 1st June 2007, 19:51

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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