Alpha Video Training
Results 1 to 5 of 5

Thread: Help required with "Stritran_multi_expressions" function

  1. #1
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    741

    Default Help required with "Stritran_multi_expressions" function

    this snippet of code appears to work, ie no error message, but the replacement has not worked.
    the field name is definitely called "Aircraft_type" and that field contains any of the "find strings".
    what am I not doing?

    Code:
    replacement_string = <<%str%
    A1=A-1
    A4=A-4
    A5=A-5
    A6=A-6
    A7=A-7
    C1=C-1
    E1=E-1
    E2=E-2
    F1=F-1
    F4=F-4
    H3=H-3
    H5=H-5
    H6=H-6
    S2=S-2
    S3=S-3
    %str%
    tbl = table.open(import_destination_table)
    update.fields = 1
    update.field1 = "aircraft_type"
    update.expr1  = "Stritran_multi_expressions(aircraft_type,Replacement_String)"
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

  2. #2
    "Certified" Alphaholic
    Real Name
    Andrew Schone
    Join Date
    Dec 2005
    Location
    Kansas
    Posts
    1,047

    Default Re: Help required with "Stritran_multi_expressions" function

    In the sample provided it is missing the tbl.update() command at the end.

    I have not played with the stritran_multi_expressions() function. Reading thru the help file I wonder if your arguments will need to be encapsulated in quotes.
    Andrew

  3. #3
    "Certified" Alphaholic glenschild's Avatar
    Real Name
    Glen Schild
    Join Date
    Apr 2000
    Location
    Frome, Somerset, UK
    Posts
    1,507

    Default Re: Help required with "Stritran_multi_expressions" function

    Quote Originally Posted by Graham Wickens View Post
    this snippet of code appears to work, ie no error message, but the replacement has not worked.
    the field name is definitely called "Aircraft_type" and that field contains any of the "find strings".
    what am I not doing?

    Code:
    replacement_string = <<%str%
    A1=A-1
    A4=A-4
    A5=A-5
    A6=A-6
    A7=A-7
    C1=C-1
    E1=E-1
    E2=E-2
    F1=F-1
    F4=F-4
    H3=H-3
    H5=H-5
    H6=H-6
    S2=S-2
    S3=S-3
    %str%
    tbl = table.open(import_destination_table)
    update.fields = 1
    update.field1 = "aircraft_type"
    update.expr1  = "Stritran_multi_expressions(aircraft_type,Replacement_String)"
    Not sure if this helps but have you dimensioned the string
    DIM replacement_string as c

    also is it case sensitive as in the update expression you have put Replacement_String

    Glen
    Glen Schild



    My Blog


  4. #4
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    741

    Default Re: Help required with "Stritran_multi_expressions" function

    Finally got it to work using different function:

    Code:
    dim shared FindStr as C
    dim shared ReplaceStr as C
    FindStr = <<%str%
    A1
    A2
    A3
    A4
    A5
    F4
    F14
    F18
    A6
    E6
    C2
    C1
    H60
    H3
    E2
    E1
    S2
    H2
    A7
    A6
    S3
    F8
    H53
    %str%
    ReplaceStr = <<%str%
    A-1
    A-2
    A-3
    A-4
    A-5
    F-4
    F-14
    F-18
    A-6
    E-6
    C-2
    C-1
    H-60
    H-3
    E-2
    E-1
    S-2
    H-2
    A-7
    A-6
    S-3
    F-8
    H-53
    %str%
    t = table.open("testdatareplace")
    update.fields = 1
    update.field1 = "aircraft_type"
    update.expr1  = "stritran_multi(aircraft_type,var->FindStr,var->ReplaceStr)"
    t.update()
    t.close()
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

  5. #5
    "Certified" Alphaholic glenschild's Avatar
    Real Name
    Glen Schild
    Join Date
    Apr 2000
    Location
    Frome, Somerset, UK
    Posts
    1,507

    Default Re: Help required with "Stritran_multi_expressions" function

    Glad you got it working, as always there is more than one way to get things done in Alpha!
    Glen Schild



    My Blog


Similar Threads

  1. What happened to my "Clarity Required" thread?
    By pulsoft in forum General Questions
    Replies: 32
    Last Post: 04-23-2012, 07:45 PM
  2. "Object Required" Error in Grid Detail - troubleshooting
    By fsi in forum Application Server Version 9 - Web/Browser Applications
    Replies: 6
    Last Post: 08-26-2009, 03:50 PM
  3. Data Entry: "Conditionally required" does not work
    By rolstra in forum Alpha Five Version 8
    Replies: 1
    Last Post: 05-09-2009, 01:23 AM
  4. Child table in set with "Always Required" field
    By aschone in forum Alpha Five Version 8
    Replies: 1
    Last Post: 11-30-2007, 04:19 PM
  5. Replies: 5
    Last Post: 03-02-2006, 04:35 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
  •