SupportJPG
  Support Home   |   Search   |   Documentation
ArticleId = kb000218

HOWTO: Prevent Numbers being formatted when outputting to ASP Pages

The information in this article applies to:

    • ASNA Visual RPG, Release 3.0 and higher
    • Windows
    • Web
    • ActiveX

SUMMARY:

This article will discuss a way in which you can prevent numbers and dates being formatted when outputting to ASP web pages.

MORE INFORMATION:

NOTE:  These methods listed below are examples.  There might be other methods in which this feature can be incorporated into an AVR application that is not mentioned in this article.

Requirements: 

  • An AVR Class for ASP
  • Microsoft IIS and COM+ / MTS installed

Program details:

Note that you will have to make a reference to the Microsoft COM+ and Active Server Pages Objects (See Figure 1 and 2).  Make sure these Objects (i.e. COM+ / MTS and IIS) exist on the Web Server where this application will run.

Note you will have to configure the Project Settings for this DLL to be created successfully (See Figure 3 and 4).

Figure 1

Figure 2

Figure 3

Figure 4

Here is the code that is needed for the AVR Class (i.e. VRC):

  // Mainline Code
  //Declarations to the ASP and COM+ Objects
DclFld AppServer     Type(COMSvcsLib.AppServer)
DclFld ObjectContext Type(COMSvcsLib.ObjectContext)
DclFld Response      Type(ASPTypeLibrary.Response)
DclFld Request       Type(ASPTypeLibrary.Request)
DclFld Session       Type(ASPTypeLibrary.Session)


DclFld Var1    Type(*Packed) Len(3,0) Scope(*Public)
DclFld Var2    Type(*Packed) Len(4,0) Scope(*Public)
DclFld Result  Type(*Packed) Len(5,2) Scope(*Public)
DclFld Result2 Type(*String)          Scope(*Public)


BEGSR Numerical_Manipulation_Class MTSActivate

  ObjectContext = AppServer.GetObjectContext()
  Response      = ObjectContext["Response"]
  Request       = ObjectContext["Request"]
  Session       = ObjectContext["Session"]

ENDSR
 

/*
   This Method will show you two different results, even though it is the same value.  Noticed one value (the Packed value) is edited by the ASP page and notice one value (the string value) is not.

*/
BEGSR Get_Values Scope(*Public)

   Var1 = 100
   Var2 = 250

   Result = (Var1 * Var2)/1000

   Result2 = Result

    Response.write("<p>Packed Result is: ")
    Response.write(Result)

    Response.write("<p>String Result is: ")
    Response.write(Result2)

ENDSR

Figure 5 demonstrates the properties for the AVR Class (VRC):

Figure 5

Here is the code for the ASP page (named "datatest.asp"):

<html>

<body>

<%
  Set MyObj = Server.CreateObject("TESTDataEditing.Numerical_Manipulation_Class")
  MyObj.Get_Values
%>

</body>

</html>

Note the results after running your ASP page in your Browser.  Make sure the browser's URL begins with HTTP://.

TIP: You can use the same method (i.e. using a string variable) for outputting dates to ASP pages from your AVR DLL.

Other ASNA KB Articles:

Other Web Articles:

Keywords: example, client, develop, IDE, "leading zeros", automation, "date format", "number format"

Last Modified Date: 2/13/2002 3:54:25 PM

Copyright © 2005, 2006 ASNA Inc.

  Support Home   |   Search   |   Documentation