Alpha Video Training
Results 1 to 5 of 5

Thread: What is the difference?

  1. #1
    Tommy
    Guest

    Default What is the difference?

    This code works fine.

    IF lookupl("F","1","disable_type_of_service","c:/eyesoft/sysdef.dbf","default_ke")=.T. THEN

    :hfca1500:TYPE_OF_SERVICE_1.disable()
    :hfca1500:TYPE_OF_SERVICE_2.disable()
    :hfca1500:TYPE_OF_SERVICE_3.disable()
    :hfca1500:TYPE_OF_SERVICE_4.disable()
    :hfca1500:TYPE_OF_SERVICE_5.disable()
    :hfca1500:TYPE_OF_SERVICE_6.disable()
    END IF

    This code returns error ( f.disable() Argument is incorrect data type). If you run trace the value of f looks just like the values in the first example. What have I done wrong?

    DIM SHARED f AS c

    IF lookupl("F","1","disable_type_of_service","c:/eyesoft/sysdef.dbf","default_ke")=.T. THEN

    for i = 1 to 6

    f = ":hfca1500:TYPE_OF_SERVICE_"+ltrim(str(i,1,0))

    f.disable()
    'traceln(f)
    next

    END IF

  2. #2
    Member
    Real Name
    Steve Andrews
    Join Date
    Jan 2004
    Location
    Mahwah, NJ
    Posts
    644

    Default RE: What is the difference?

    Tommy,

    In your second batch of code, the system takes f as a character string - not as a pointer to a button. I assume that your "TYPE_OF_SERVICE_n" objects are buttons.

    If the two lines invlolving f are replaced with the following, it may work out. Give it a try.

    Code:
    eval(":hfca1500:TYPE_OF_SERVICE_"+ltrim(str(i,1,0))+".disable()")
    My 2 cents,
    Steve

  3. #3
    Tommy
    Guest

    Default RE: What is the difference?

    Actually the TYPE_OF_SERVICE_n objects are fields on a form. I tried this but still got the same error. (Argument is incorrect data type) This is what I tried. Thanks

    IF lookupl("F","1","disable_type_of_service","c:/eyesoft/sysdef.dbf","default_ke")=.T. THEN

    for i = 1 to 6

    eval(":hfca1500:TYPE_OF_SERVICE_"+ltrim(str(i,1,0))+".disable()")

    next

    END IF

    END

  4. #4
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default RE: What is the difference?

    I think it's a bad practice to use the same pointer for multiple things. Having said that, however ...

    With a pointer to the form, can't you get a pointer to any field object with something like this?

    fld_ptr = frm_ptr.child("FieldObjectName")


    With this approach couldn't you get pointers to
    f1
    f2
    f3
    f4
    f5
    f6

    and so on, by passing a string to the .child method that contains the fieldobjectname ?

    -- tom

    --

  5. #5
    Tommy
    Guest

    Default RE: What is the difference?

    I give this a try. I'm on another project now. I'll let you know what happens. Thanks

Similar Threads

  1. no difference
    By Tony Agnone in forum Alpha Five Version 5
    Replies: 1
    Last Post: 08-12-2005, 11:13 AM
  2. Why The Difference
    By Phil Rolf in forum Web Application Server v6
    Replies: 7
    Last Post: 11-23-2004, 02:45 AM
  3. Why The Difference
    By Phil Rolf in forum Alpha Five Version 6
    Replies: 5
    Last Post: 11-21-2004, 08:33 AM
  4. What's the difference?
    By Jerry Gray in forum Alpha Five Version 6
    Replies: 0
    Last Post: 10-27-2004, 08:33 AM
  5. [ or ( - What's the difference?
    By CharlesK in forum Alpha Five Version 4
    Replies: 10
    Last Post: 08-14-2001, 05:30 AM

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
  •