Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Pointers - Working with pointers returned from <TBL>.FIELD.GET()

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Re: Pointers - Working with pointers returned from &lt;TBL&gt;.FIELD.GET()

    Originally posted by Stan Mathews View Post
    When you use table.current() you are accepting the default parameter of 1 which is the top level table in a set. You refer to lower level tables with their position number.

    table.current(2)
    table.current(3)
    table.current(4)
    etc.

    When the onactivate event fires there is no current field. Try this for the onactivate event code.
    Code:
    delete obj
    delete obj_table_ptr
    delete obj_field_ptr
    
    obj_table_ptr_name = ""
    obj_field_ptr_name = ""
    obj = parentform.this
    obj_table_ptr = obj.table_get()
    obj_table_ptr_name = obj_table_ptr.name_get()
    
    [B][COLOR="#FF0000"]obj_field_ptr = this.this[/COLOR][/B]
    obj_field_ptr_name = obj_field_ptr.name()
    
    ui_msg_box("",""+obj_table_ptr_name)
    ui_msg_box("",""+obj_field_ptr_name)
    You should get messages telling you the name of the table and the name of the form.

    You might try the same for the onarrive event of a form.
    I found this iine of code very "intriguing."

    I''m wondering why this doesn't work: vp_Field = vp_Field.NAME_GET().this (when used in the context of my OP)
    ~I know it's "redundant", but at first I thought it just might "technically" result in working code....

    Actually, my thoughts are: It doesn't work because you can't re-associate the character field result (returned from NAME_GET()) back to a pointer reference. ~ In other words, "You can't associate a pointer when a character result is returned?"

    Explained in another way: Reference to the pointer vp_Field is lost when the function/method NAME_GET() is performed on the pointer itself.)
    Robert T. ~ "I enjoy manipulating data... just not my data."
    It's all about the "framework." (I suppose an "a5-induced" hard drive crash is now in order?)
    RELOADED: My current posting activity here merely represents a "Momentary Lapse Of Reason."

    Comment


      #17
      Re: Pointers - Working with pointers returned from &lt;TBL&gt;.FIELD.GET()

      Code:
      delete obj
      delete obj_table_ptr
      delete obj_field_ptr

      obj_table_ptr_name = ""
      obj_field_ptr_name = ""
      obj = parentform.this
      obj_table_ptr = obj.table_get()
      obj_table_ptr_name = obj_table_ptr.name_get()

      obj_field_ptr = this.this
      obj_field_ptr_name = obj_field_ptr.name()

      ui_msg_box("",""+obj_table_ptr_name)
      ui_msg_box("",""+obj_field_ptr_name)You should get messages telling you the name of the table and the name of the form.

      You might try the same for the onarrive event of a form.
      Stan,
      I tried the above and the correct field name is displayed in the message box(great), but the first message box contains the primary table for the set(not so great). Having the field name, I thought you could get which table it is a field of but I cannot do it. I tried using .<OBJECT>.TABLE_GET() in the above but I could not get it to display the appropriate table. Any ideas for this?

      Comment


        #18
        Re: Pointers - Working with pointers returned from &lt;TBL&gt;.FIELD.GET()

        Are you supposed to delete an object variable before re-assigning it to point to another object? ~ I don't understand the significance of the delete statements... (I thought I had read it is is a bad practice to delete variables of any type, due to speed and efficiency considerations.)
        Robert T. ~ "I enjoy manipulating data... just not my data."
        It's all about the "framework." (I suppose an "a5-induced" hard drive crash is now in order?)
        RELOADED: My current posting activity here merely represents a "Momentary Lapse Of Reason."

        Comment


          #19
          Re: Pointers - Working with pointers returned from &lt;TBL&gt;.FIELD.GET()

          Originally posted by SNusa View Post
          Are you supposed to delete an object variable before re-assigning it to point to another object? ~ I don't understand the significance of the delete statements... (I thought I had read it is is a bad practice to delete variables of any type, due to speed and efficiency considerations.)
          How about my earlier idea above in post #12? (Setting a session pointer to the table using the onChange record event so you know which table was updated?) ~Then have each table call the same function (after setting and passing the pointer to the table... usingvp_tbl=table(current) to grab the pointer) to write to the log file.... ?
          Last edited by SNusa; 02-06-2012, 10:15 PM.
          Robert T. ~ "I enjoy manipulating data... just not my data."
          It's all about the "framework." (I suppose an "a5-induced" hard drive crash is now in order?)
          RELOADED: My current posting activity here merely represents a "Momentary Lapse Of Reason."

          Comment


            #20
            Re: Pointers - Working with pointers returned from &lt;TBL&gt;.FIELD.GET()

            Robert,
            I really need it to work in the onarrive event.

            Here is what I am doing using action scripting on one field[5 tables on a form with one one-to-many browse]
            (I have 40 other fields I want to use this on and this is why I want to make it a function)
            On Arrive:
            Manually set a variable to the field name, and one to the type of field, and one to a field title appropriate for a user to see.
            Also, Set variable to value of field prior to change

            On Change Event:
            Set second variable to new value
            Request PIN number of associate (If they have not made a previous PIN entry in the last minute)
            If PIN is NOT valid, restores previous value and saves record
            If PIN is valid
            Saves the change – saves the time of the change(for the above 1 minute autologout)
            Gets employee # from the PIN Table
            Compares current value with previous value, they should be different, and if they are, writes a new record to an external table which saves the reservation number, employee number, date/time, and the field title and the previous value and the new value for auditing purposes.

            This works great with action scripting, but I am trying to make it as universal as I can using a function. I know may have to set some variables with each individual field, but I was trying to get some of the information automatically. I have a dozen users with one terminal making many changes at a time. Much of the time is just looking at info and I didn’t want to force a login logout for each, it would be way too much of a pain. This way anyone can look at the data and if they need to make a change, they have to enter their PIN once as long as they make a change every 60 seconds. If this stirs up any new ideas, I would love to hear them.

            Another big one is can you dim a variable using a variable for the type of field?
            Last edited by johngtatp; 02-07-2012, 03:08 PM.

            Comment


              #21
              Re: Pointers - Working with pointers returned from &lt;TBL&gt;.FIELD.GET()

              Originally posted by johngtatp View Post
              Another big one is can you dim a variable using a variable for the type of field?
              Code:
              tst = "C"
              
              evaluate_template("Dim my_variable as "+tst)
              ? my_variable
              = ""
              
              ? typeof(my_variable)
              = "C"
              Which of course means you can....

              Code:
              tst_type = "C"
              tst_vName = "some_variable_name"
              
              
              evaluate_template("Dim "+tst_vName+" as "+tst_type)
              
              ? eval(tst_vname)
              = ""
              
              ? typeof(tst_vName)
              = "C"
              
              or
              
              ? some_variable_name
              = ""
              
              ? typeof(some_variable_name)
              = "C"
              Last edited by Stan Mathews; 02-07-2012, 03:32 PM.
              There can be only one.

              Comment


                #22
                Re: Pointers - Working with pointers returned from &lt;TBL&gt;.FIELD.GET()

                Stan, that helps. I was using eval only, never used eval template. Thanks for that one.

                Comment


                  #23
                  Re: Pointers - Working with pointers returned from &lt;TBL&gt;.FIELD.GET()

                  Evaluate_template is very near Eval in the wiki.

                  •EVAL Function
                  •EVALUATE_STRING Function
                  •EVALUATE_TEMPLATE Function
                  •EVALUATE_TEMPLATE_PRIVATE Function
                  There can be only one.

                  Comment


                    #24
                    Re: Pointers - Working with pointers returned from &lt;TBL&gt;.FIELD.GET()

                    Stan, it works with C but not anything else

                    dim vartype as c
                    vartype = "P"
                    ?vartype
                    = "P"

                    evaluate_template("dim shared testt as"+vartype)
                    ?typeof(testt)
                    = "C"
                    Thats what I got...

                    Comment


                      #25
                      Re: Pointers - Working with pointers returned from &lt;TBL&gt;.FIELD.GET()

                      Works with all types I think. You need a space after as.

                      ? "dim shared testt as"+vartype
                      = "dim shared testt asP"

                      ? "dim shared testt as "+vartype
                      = "dim shared testt as P"
                      There can be only one.

                      Comment


                        #26
                        Re: Pointers - Working with pointers returned from &lt;TBL&gt;.FIELD.GET()

                        That was it, the space. Now if I can just solve the rest... ;)

                        Comment


                          #27
                          Re: Pointers - Working with pointers returned from &lt;TBL&gt;.FIELD.GET()

                          Originally posted by johngtatp View Post
                          That was it, the space. Now if I can just solve the rest... ;)
                          Well, one of the things I'm thinking is you are going to have to put some code on all the "can" events to cancel the save (in the event pin is not good), right? ~Thad being said, why not put all the code on the can events of each table? (Including the call the to the function.)

                          That way, you're either updating the field and recording the the log file, or you're issuing a cancel to the edit, add, update...
                          Robert T. ~ "I enjoy manipulating data... just not my data."
                          It's all about the "framework." (I suppose an "a5-induced" hard drive crash is now in order?)
                          RELOADED: My current posting activity here merely represents a "Momentary Lapse Of Reason."

                          Comment


                            #28
                            Re: Pointers - Working with pointers returned from &lt;TBL&gt;.FIELD.GET()

                            Anyone using this thread for reference: Code in thread title should read <TBL>.FIELD_GET()
                            (A hyphen should have been used (instead of the period) in the <TBL>.FIELD.GET() method) ~ See red underscore (corrected) above!
                            Robert T. ~ "I enjoy manipulating data... just not my data."
                            It's all about the "framework." (I suppose an "a5-induced" hard drive crash is now in order?)
                            RELOADED: My current posting activity here merely represents a "Momentary Lapse Of Reason."

                            Comment

                            Working...
                            X