Print Page | Close Window

FGetVar?

Printed From: SalesCart
Category: Legacy Products
Forum Name: SalesCart Standard / PRO / SQL
Forum Description: All questions pertaining to SalesCart Standard, PRO and SQL should be posted here.
URL: http://forum.salescart.com/forum/forum_posts.asp?TID=471
Printed Date: November/24/24 at 5:16am
Software Version: Web Wiz Forums 11.04 - http://www.webwizforums.com


Topic: FGetVar?
Posted By: jimgub
Subject: FGetVar?
Date 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



Replies:
Posted By: lleemon
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.04 - http://www.webwizforums.com
Copyright ©2001-2015 Web Wiz Ltd. - http://www.webwiz.co.uk