[SOLVED !] GETFIELD Command in the Library


Closed Thread
Results 1 to 7 of 7

Thread: GETFIELD Command in the Library2079 days old

  1. #1
    AnthonyHarris
    Guest AnthonyHarris's Avatar

    0 Not allowed!

    Default GETFIELD Command in the Library

    Has anyone had any success using the getfield command within the arrays heading in the library manager, Ive copied the example (and added the nessecary device xtal etc) within the help files but I get this error

    Variable 'DELIMIT' not found in _Lib.php

    Dim DestString As String *10Dim SourceString As String * 30
    Dim InputVal As Byte

    SourceString = "ABC,DEFG,HIJKL,MNOPQR,STUVWXY"
    Loop:
    HSerOut["Enter a Field Number ", $0D, "> "]
    L1:
    HSerIn 10000, Loop, [InputVal]
    If InputVal < $30 Then GoTo L1
    If InputVal > $34 Then GoTo L1

    GetField[InputVal], SourceString, DestString

    HSerOut["Field ", Dec TmpIdx, " Contains ", DestString, $0D, $0D]
    GoTo Loop
    Stop

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.

  • #2
    Prolific Poster johngb's Avatar
    Join Date
    Oct 2003
    Posts
    2,165
    Thumbs Up
    Received: 96
    Given: 1
    Total Downloaded
    2.75 GB

    0 Not allowed!

    Default Re: GETFIELD Command in the Library

    I'll take a look at it tomorrow - I wrote this quite a few years ago now, I will have to look at the code generated to see what is going wrong.
    JohnB

  • 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
    AnthonyHarris
    Guest AnthonyHarris's Avatar

    0 Not allowed!

    Default Re: GETFIELD Command in the Library

    Perfect Thank you John
    Although doubt it is your code more likely me, Im assuming this will work (judging from the description) as a split command ?

  • 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.

  • #4
    Prolific Poster johngb's Avatar
    Join Date
    Oct 2003
    Posts
    2,165
    Thumbs Up
    Received: 96
    Given: 1
    Total Downloaded
    2.75 GB

    0 Not allowed!

    Default Re: GETFIELD Command in the Library

    I have a solution.
    You will have to open up the Arrays library. Right click on the Arrays library to open.
    Scroll down to the last Macro entry (GetField)
    locate Dim Delimit and comment it out. It is on line 783 on my system.
    Now in your program you need to do this...

    Code:
    Device = 18F452
    Xtal 4MHz
    
    Dim Delimit As Byte;
    
    Include "Untitled_Lib.pbp"
    
    Dim DestString As String *10
    Dim SourceString As String * 30
    Dim InputVal As Byte
    
    SourceString = "ABC,DEFG,HIJKL,MNOPQR,STUVWXY"
    Loop:
    HSerOut["Enter a Field Number ", $0D, "> "]
    L1:
    HSerIn 10000, Loop, [InputVal]
    If InputVal < $30 Then GoTo L1
    If InputVal > $34 Then GoTo L1
    
    GetField[InputVal], SourceString, DestString, ","
    
    HSerOut["Field ", Dec InputVal, " Contains ", DestString, $0D, $0D]
    GoTo Loop
    Stop
    Notice here that I have added the Default variable to the main program.
    This must come before the library include statement.

    Also added the include Untitled_lib.pbp - replace Untitled with your program name.
    Now you have a choice -
    • You can set the Delimiter in your main program
    • or you must provide the delimiter each time you call GetField.
    I also noticed that the HSerout line should really use InputVal rather that TmpIdx.

    Hope that sorts you out
    JohnB

  • 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
    AnthonyHarris
    Guest AnthonyHarris's Avatar

    0 Not allowed!

    Default Re: GETFIELD Command in the Library

    Hello John

    Thank you for spending time and having a look for me its much appreciated.

    I have followed your instructions and have found line 783 commented out the DIm instruction

    It wouldnt compile at first and told me to rebuild the library this I did but it stil wouldnt work however a reboot of the computer fixed that one.
    The programme is now working with the exeption of actuallty getting the field


    If I enter 1 into the serial term I get a reply back of
    Field 49 Contains
    Enter a Field Number
    >


    AS you can see I dont get the conatains part returned,

    Ive check the variable and sourcestring does contain the source and inputval did contain the input value. Im not sure quite what Im doing wrong

    would you mind helping out and pointing me in the right direction again

    Many Thanks

  • 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.

  • #6
    Prolific Poster johngb's Avatar
    Join Date
    Oct 2003
    Posts
    2,165
    Thumbs Up
    Received: 96
    Given: 1
    Total Downloaded
    2.75 GB

    0 Not allowed!

    Default Re: GETFIELD Command in the Library

    I will have a look at this but you will have to wait until Tuesday next week when I will be back at my PC.
    In the meantime you could look at the routine that does the split in the Library. Try making it a subroutine, and calling it directly from your program.
    JohnB

  • 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
    AnthonyHarris
    Guest AnthonyHarris's Avatar

    0 Not allowed!

    Default Re: GETFIELD Command in the Library

    Thank you John

    That would be much appreciated, in the mean time ill have a play and see if I can figure out your code and also have a play with the macro generator

  • 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. New CAN Library
      By RGV250 in forum CAN Module
      Replies: 6
      Last Post: 17th September 2019, 21:12
    2. Looking for a CAN library
      By SCV in forum Proton 24
      Replies: 1
      Last Post: 7th December 2018, 16:44
    3. New Library Available
      By johngb in forum Library Manager
      Replies: 0
      Last Post: 11th April 2007, 09:35
    4. [SOLVED !] library
      By ADLIN SYSTEMS in forum Library Manager
      Replies: 3
      Last Post: 23rd July 2006, 10:36
    5. [SOLVED !] i need rc5 library
      By matelda in forum Proton Plus Compiler v3
      Replies: 0
      Last Post: 15th May 2006, 09:57

    Members who have read this thread since 3rd December 2019, 05:04 : 0

    Actions :  (Set Date)  (Clear Date)

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

    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