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

XDialog: How to use a variable in a textbox

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

    XDialog: How to use a variable in a textbox

    The idea is to construct a flexible input navigation in XDialog.
    I want to use a variable for the 'Max_Chars' parameter. see screenshot.
    Not: [30.20Lastname] But something like: [var.20Lastname]

    Who can give me a helpfull syntax.

    TIA

    Ton
    Most things are simple but unfortunately only after the first time

    #2
    Re: XDialog: How to use a variable in a textbox

    Sorry, but here is the screenshot.
    Most things are simple but unfortunately only after the first time

    Comment


      #3
      Re: XDialog: How to use a variable in a textbox

      HI Ton

      Give a look at this post - especially post 12 and after which shows how to use stritran() furnction to change the a variable in an xdialog


      http://msgboard.alphasoftware.com/al...ad.php?t=86630

      I think this is what you are referring to

      Tom Baker

      Comment


        #4
        Re: XDialog: How to use a variable in a textbox

        Try this:
        Code:
        dim vtext as C="The number of characters in this line"
        vtext=vtext+" will be different depending on the input"
        vtext=vtext+" and especially when the input is extremely long"
        vtext=vtext+" will there be a difference that the user can actually"
        vtext=vtext+" see with their own eyes"
        
        dim vn_text_len as N
        dim vn_MaxChar as n
        vn_text_len=len(vtext)
        
        if vn_text_len>70
        	vn_MaxChar=int(vn_text_len/2)
        		'msgbox("Len: "+str(vn_text_len),str(vn_MaxChar))
        	vn_lines=int(vn_MaxChar/70)+1
        else
        	vn_MaxChar=vn_text_len+3
        end if
        
        dim dlg_title as C="Text length by Character"
        dim dlg_body as C
        dim dlg_code as C
        
        dim vn_lines as n
        dim z1 as c
        dim z2 as C
        dim vR as C
        
        z1=<<%dg1%
        {background=pale yellow}{font=Arial,10}{justify=top}
        {startup=initiate}
        {lf};
        Text here: [%w%.%dg1%
        
        z2=<<%dg2%
        vtext];
        {lf};
        {line=1,0}
        {lf};
        {justify=center}<10OK> <10Cancel>
        %dg2%
        
        dlg_code=<<%code%
        IF a_dlg_button="initiate"
        	sys_send_keys("{HOME}")
        	a_dlg_button=""
        END IF
        %code%
        
        dim vLL as C
        vLL=alltrim(str(vn_MaxChar))+","+alltrim(str(vn_lines))
        dlg_body=z1+vLL+z2
        	'msgbox(str(vn_MaxChar),dlg_body)
        vR=ui_dlg_box(dlg_title,dlg_body,dlg_code)
        
        if vR="cancel"
        	end 
        end if
        Last edited by Mike Wilson; 07-24-2010, 06:14 PM.
        Mike W
        __________________________
        "I rebel in at least small things to express to the world that I have not completely surrendered"

        Comment


          #5
          Re: XDialog: How to use a variable in a textbox

          Hi Tom

          Thank you for your reply but it's a little bit different I think. Changing the value of a variable is not the problem.

          In a textbox in the dialog you can type in the max chars and also the number to chars to display the Lastname.
          e.g. --> [30.20Lastname]

          But what I want is to be able to change the 30 into another value so thats why I want to use a variable like: [(var).20Lastname]
          Question is how to achieve that. Cannot find the right syntax (if there is).

          Ton
          Most things are simple but unfortunately only after the first time

          Comment


            #6
            Re: XDialog: How to use a variable in a textbox

            Ton,
            Do as MikeW showed....have your xdialog body as separate text that is set to a variable. Then you can add variables to it as is done for many things...

            such as
            dlg_body="some text"
            dlg_body=dlg_body+s_quote(your_variable)
            dlg_body=dlg_body+"rest_of_text"

            Is one way.....
            Mike
            __________________________________________
            It is only when we forget all our learning that we begin to know.
            It's not what you look at that matters, it's what you see.
            Henry David Thoreau
            __________________________________________



            Comment


              #7
              Re: XDialog: How to use a variable in a textbox

              Hi Mike,

              Thanks for your example.
              I have examined it and it's another approach as I had imagined. But very instructive.
              As the variable is filled during data entry, the dialog is already running at that time.
              So I now must find a way how to apply this construction.
              I'll give it a try.

              Ton
              Most things are simple but unfortunately only after the first time

              Comment


                #8
                Re: XDialog: How to use a variable in a textbox

                Hi MikeC

                Yes, yes but as I wrote before, it's an alreay running XDialog.
                Maybe the solution must be found using a ui_dlg_refresh command.
                Have you ever used it?

                Thank you for answer.

                Ton
                Most things are simple but unfortunately only after the first time

                Comment


                  #9
                  Re: XDialog: How to use a variable in a textbox

                  Ton,
                  I believe the refresh is what you need....but I have tried to use it in the past without success....maybe others that have successfully used it will chime in.
                  Mike
                  __________________________________________
                  It is only when we forget all our learning that we begin to know.
                  It's not what you look at that matters, it's what you see.
                  Henry David Thoreau
                  __________________________________________



                  Comment


                    #10
                    Re: XDialog: How to use a variable in a textbox

                    Try
                    ui_dlg_commit("dialogname") for refresh
                    -----------------------------------------------
                    Regards
                    Mark Pearson
                    [email protected]
                    Youtube channel
                    Website

                    Comment


                      #11
                      Re: XDialog: How to use a variable in a textbox

                      Originally posted by Ton Spies View Post
                      Hi MikeC

                      Yes, yes but as I wrote before, it's an alreay running XDialog.
                      Maybe the solution must be found using a ui_dlg_refresh command.
                      Have you ever used it?
                      Like MikeC I have not gotten refresh to work either. I am a bit baffled by what you are trying to accomplish now that you say you want to alter the dialog text box based upon a variable length and this dialog is already opened before the variable value is established? You must be running a modeless dialog?

                      Maybe alphabet soup in this thread can give you some ideas.
                      http://msgboard.alphasoftware.com/al...=alphabet+soup
                      Mike W
                      __________________________
                      "I rebel in at least small things to express to the world that I have not completely surrendered"

                      Comment


                        #12
                        Re: XDialog: How to use a variable in a textbox

                        Originally posted by Clunes View Post
                        Try
                        ui_dlg_commit("dialogname") for refresh

                        This is in the AlphaFiveHelp.chm:
                        The UI_DLG_COMMIT() function forces the contents of edit controls to be stored into variables. This is rarely necessary.

                        I have no idea when you need this and how it works.
                        Can you be more specific in when, why and how you use it?

                        TIA

                        Ton
                        Most things are simple but unfortunately only after the first time

                        Comment


                          #13
                          Re: XDialog: How to use a variable in a textbox

                          Originally posted by Mike Wilson View Post
                          I am a bit baffled by what you are trying to accomplish now that you say you want to alter the dialog text box based upon a variable length and this dialog is already opened before the variable value is established? You must be running a modeless dialog?
                          Hi Mike,

                          I was looking for additional opportunities for the syntax of a textbox. Hence my simple example with 'Last Name'.

                          To unbaffel you the story is simple.
                          In some cities people have a phone number with 7 digits.
                          In other areas they have a telephone number of 6 digits.
                          Only when entering an address is known which city it is.
                          So halfway. can be determined the length of the phone.
                          To make the story complete:
                          Each city has its own number. This consists of 3 or 4 digits.
                          I add these automaticly while data is entered.
                          This gives everyone a phone number with 10 digits.
                          So it's not a modeless dialog.


                          Thank you for pointing me to the alphabet soup. Always nice to get some new ideas with such nice examples.

                          Can you tell me why your refresh attempt failed?
                          Documentation about this is very poor.

                          Ton
                          Most things are simple but unfortunately only after the first time

                          Comment


                            #14
                            Re: XDialog: How to use a variable in a textbox

                            Why do you want to change that code? The text box will take unlimited characters irrespective of length. If you are trying to restrict the user input to a lenght that may be variable depending on preceding inputs then you can use the controls change/killfocus event to validate.
                            -----------------------------------------------
                            Regards
                            Mark Pearson
                            [email protected]
                            Youtube channel
                            Website

                            Comment


                              #15
                              Re: XDialog: How to use a variable in a textbox

                              Ton,
                              Rather than trying to use a variable in a control, why not just use {condition=} to show 2 different versions of the control?

                              Example (try with Postal code ="1" or "2"):
                              Code:
                              dlg=<<%txt%
                              Postal code: [2.3postal];
                              
                              {condition=postal="1"}
                              Phone: [6.7phone]
                              {condition=postal="2"}
                              {start_pos}
                              Phone: [8.9phone];
                              <OK>;
                              %txt%
                              
                              ui_dlg_box("Test",dlg)

                              Comment

                              Working...
                              X