Alpha Video Training
Results 1 to 5 of 5

Thread: What am I doing wrong with dialog

  1. #1
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default What am I doing wrong with dialog

    Help please, I just cant get the second row to line up properly.
    Code:
    dim shared a_valid_month[12] as c
    x = "01,02,03,04,05,06,07,08,09,10,11,12"
    a_valid_month.initialize(stritran(x,",",crlf()))
    
    dim shared a_valid_year[10] as c
    x = "2012,2013,2014,2015,2016,2017,2018,2019,2020,2021"
    a_valid_year.initialize(stritran(x,",",crlf()))
    
    dim shared a_expire_month[12] as c
    x = "01,02,03,04,05,06,07,08,09,10,11,12"
    a_expire_month.initialize(stritran(x,",",crlf()))
    dim shared a_expire_year[10] as c
    x = "2012,2013,2014,2015,2016,2017,2018,2019,2020,2021"
    a_expire_year.initialize(stritran(x,",",crlf()))
    dim shared vc_cc1 as c
    dim shared vc_cc2 as c
    dim shared vc_cc3 as c
    dim shared vc_cc4 as c
    
    result = ui_dlg_box("Credit Card Details",<<%dlg%
    {region}
    Card Number:|{sp=2}[%+%4.5vc_cc1]{sp=2}[%+%4.5vc_cc2]{sp=2}[%+%4.5vc_cc3]{sp=2}[%+%4.5vc_cc4];
    {endregion}
    {region}
    Valid from:|[.4valid_month^=a_valid_month] [.5valid_year^=a_valid_year] ;
    {region}
    Expiration:|[.4expiry_month^=a_expire_month] [.5expiry_year^=a_expire_year] ;
    {endregion};
     <10&OK>|<10&Cancel>
    
    %dlg%)
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  2. #2
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: What am I doing wrong with dialog

    Code:
    dim shared a_valid_month[12] as c
    x = "01,02,03,04,05,06,07,08,09,10,11,12"
    a_valid_month.initialize(stritran(x,",",crlf()))
    
    dim shared a_valid_year[10] as c
    x = "2012,2013,2014,2015,2016,2017,2018,2019,2020,2021"
    a_valid_year.initialize(stritran(x,",",crlf()))
    
    dim shared a_expire_month[12] as c
    a_expire_month.copy_from(a_valid_month)
    dim shared a_expire_year[10] as c
    a_expire_year.copy_from(a_valid_year)
    
    dim shared vc_cc1 as c
    dim shared vc_cc2 as c
    dim shared vc_cc3 as c
    dim shared vc_cc4 as c
    
    result = ui_dlg_box("Credit Card Details",<<%dlg%
    {region}
    Card Number:| [%+%4.5vc_cc1]{sp=2}[%+%4.5vc_cc2]{sp=2}[%+%4.5vc_cc3]{sp=2}[%+%4.5vc_cc4];{lf};
    Valid from:| [.4valid_month^=a_valid_month] [.5valid_year^=a_valid_year];{lf};
    Expiration:| [.4expiry_month^=a_expire_month] [.5expiry_year^=a_expire_year] ;
    {endregion};
     <10&OK>|<10&Cancel>
    %dlg%)
    I made the necessary corrections..and then couple improvs.

  3. #3
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: What am I doing wrong with dialog

    And just for the heck of it, there are several ways to improvise on this:
    1-I posted an example in the past showing how to recycle the same array to use it in an xdlg and get the return based on which control has focus, or
    2-In your xdlg code, you could use different event name for the same array, thus use 2 arrays instead of 4, or
    3-The clever way, which is almost always the simplest way:

    Code:
    dim shared a_valid_month[12] as c
    x = "01,02,03,04,05,06,07,08,09,10,11,12"
    a_valid_month.initialize(stritran(x,",",crlf()))
    
    dim shared a_valid_year[10] as c
    x = "2012,2013,2014,2015,2016,2017,2018,2019,2020,2021"
    a_valid_year.initialize(stritran(x,",",crlf()))
    
    dim shared vc_cc1 as c
    dim shared vc_cc2 as c
    dim shared vc_cc3 as c
    dim shared vc_cc4 as c
    
    result = ui_dlg_box("Credit Card Details",<<%dlg%
    {region}
    Card Number:| [%+%4.5vc_cc1]{sp=2}[%+%4.5vc_cc2]{sp=2}[%+%4.5vc_cc3]{sp=2}[%+%4.5vc_cc4];{lf};
    Valid from:| [.4valid_month^=a_valid_month] [.5valid_year^=a_valid_year];{lf};
    Expiration:| [.4expiry_month^=a_valid_month] [.5expiry_year^=a_valid_year] ;
    {endregion};
     <10&OK>|<10&Cancel>
    %dlg%)

  4. #4
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: What am I doing wrong with dialog

    Thanks Gabe,

    It was the {lf} I was missing.

    Nice use of Arrays, thanks for that tip too.
    Last edited by Keith Hubert; 08-06-2012 at 11:01 AM.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  5. #5
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: What am I doing wrong with dialog

    No.
    Your regions were garbled.
    You didn't end your second region, and more importantly, you didn't put a hard return after the first one.
    I did away with them. They were not needed anyway.
    Last edited by G Gabriel; 08-06-2012 at 11:38 AM.

Similar Threads

  1. Linking a Dialog to another Dialog like a Linked Grid/Content
    By jmsilva in forum Application Server Version 11 - Web/Browser Applications
    Replies: 6
    Last Post: 06-25-2012, 05:26 PM
  2. Dialog For Editing Grid Items: Using same dialog for updates and inserts
    By dionmccormick in forum Application Server Version 11 - Web/Browser Applications
    Replies: 3
    Last Post: 01-17-2012, 02:24 PM
  3. Filtering Dialog DropDown (What am I doing wrong?)
    By Rich Hartnett in forum Application Server Version 10 - Web/Browser Applications
    Replies: 5
    Last Post: 05-15-2011, 05:26 PM
  4. What do I have wrong in my dialog box script?
    By joannristau in forum Alpha Five Version 9 - Desktop Applications
    Replies: 1
    Last Post: 03-06-2009, 06:42 PM
  5. Wrong icon in dialog (modal) form
    By Bonbon in forum Alpha Five Version 9 - Desktop Applications
    Replies: 0
    Last Post: 07-28-2008, 12:10 PM

Bookmarks

Posting Permissions

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