Forum Home Forum Home > Legacy Products > SalesCart Standard / PRO / SQL
  New Posts New Posts RSS Feed - FGetVar?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Forum LockedFGetVar?

 Post Reply Post Reply
Author
Message
jimgub View Drop Down
Newbie
Newbie


Joined: April/15/04
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimgub Quote  Post ReplyReply Direct Link To This Post Topic: FGetVar?
    Posted: October/24/05 at 6:43am
I noticed that when my Name field in the products db is set as MEMO I get "None" displayed in the shopping Cart "Description" field (i.e. VIEW Cart).. In trying to troubleshoot this, I noticed a variable/function in the code called FGetVar, which does some massaging of the data. What is this? I couldn't find out what this does.. eitehr way, changing Name field to TEXT fixes problem...

Thx
Jim
Back to Top
lleemon View Drop Down
Groupie
Groupie


Joined: March/16/04
Location: United States
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote lleemon Quote  Post ReplyReply Direct Link To This Post Posted: October/27/05 at 6:19am
I think this is what you are interested in.



'----------------------------------------------------------- ---------
' FGETVAR: Returns a varible from a Request object and initializes it if its empty
' Call FGetVar(variable name,default,type) type =s for string; n for number
'----------------------------------------------------------- ---------
Public Function FGetVar(var,thedefault,thetype)
     ' Perform IDC style DefaultParameter processing.
     If IsEmpty(Request(var)) Or Request(var) = "" or Request(var) = " " Then
     'The field is empty. Handle the empty field condition
           If thetype = "s" Then
                MyVar = (CStr(thedefault))
           Else
                MyVar = thedefault
           End IF
     Else
     'The field is not empty. Process the value
     'First handle error conditions
     If IsNumeric(Request(var)) = False and thetype = "n" Then
           Response.write ("Expecting a number instead of a string for: " & var)
           Response.end
     End If
     
     If thetype = "n" Then
           MyVar = ABS(Request(var))
     Else
           MyVar = Request(var)
           'Replace single quote with two single quotes
           MyVar = Replace(MyVar,"'","''")
     End If

     End If
           'response.write (thedefault)
           FGetVar = My
End Function
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.04
Copyright ©2001-2015 Web Wiz Ltd.

Copyright 2015 by ComCity® LLC and SalesCart™.  All Rights Reserved