Problem: SERIN2 and long arrays...


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

    Default Re: Problem: SERIN2 and long arrays...

    Hi,
    It sounds to me like one array is "spilling over" into the next. PBP doesn't have perform boundry checking on arrays so you can easily write outside it of its "space". When you add your dummy array the data from operation A spills over into the dummy array instead of into the "real" array where you see the zeros.

    That'a a theory....

    /Henrik.

  2. #2
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: Problem: SERIN2 and long arrays...

    I send fixed len. strings from vb, and it doesn't matter where I put dummy variable. I try to to add dummy after mail_pass, and again everything it's ok. So now I don't have clue what it is happening...
    I have 661 byte 2 words and 4bits before Mail_user.
    And if I swap place of Mail_Pass and any array, _pass is ok, and that replaced array isn't ok...

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

    Default Re: Problem: SERIN2 and long arrays...

    Hi,
    Preload your dummy array with all 255's or whatever, then after your SERIN statement, dump the content of the dummy array and see if IT now has your zeros. Then you KNOW that something is writing outside of where it should.

    /Henrik.

  4. #4
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: Problem: SERIN2 and long arrays...

    Add this before serin2
    for i = 0 to 34
    MAil_123[i]="A"
    next i
    hserout [str mail_123,13,10]
    and after serin2
    hserout [str mail_123,13,10]
    From first HSEROUT got AAA... then CrLf, second Hserout got just CrLf...
    I try to move Mail_123 var byte[36], and that array is always cleared...

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

    Default Re: Problem: SERIN2 and long arrays...

    Hi,
    Are you SURE you're sending the correct length strings from your VB program? Have you verified that?
    Have you tried breaking it up in several SERIN statements?

    I still think something is either writing outside of "its space" or not getting enough bytes so the next input "spans" two arrays or something...

    /Henrik.

  6. #6
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: Problem: SERIN2 and long arrays...

    I'm 100% sure that i send correct length... I check this several time's.
    Now I'll try.

  7. #7
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: Problem: SERIN2 and long arrays...

    serin2 PC_RX,8588,1000,PC_Data_Mail,[wait("Mail:"), str Mail_Alrm\5]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str MailServer\20]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str Mail_port\6]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str Mail_User\35]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str Mail_Pass\35]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str Mail_Adr\30]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str Mail_Subj\20]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str Mail_Msg\50]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str Mail_FileName\20]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[Mail_Name_Tip]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str Mail_RCPT1\35]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str Mail_RCPT2\35]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str Mail_RCPT3\35]I try to use Mail_pass in another serin2 statement, and same problem. I try to put another var, before and after in serin2 statement and same...
    It won't to work without dummy var...

  8. #8
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

    Default Re: Problem: SERIN2 and long arrays...

    And you have all your arrays declared properly, ie Arrayname VAR BYTE[Lenght] ?
    I once forgot the [] around the length and it led to quite a bit of headache untill I posted the code here and someone spotted it right away.

    /Henrik.

  9. #9
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: Problem: SERIN2 and long arrays...

    I'll just leave dummy array, and continue...
    Thank anyway.

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