Conny Absent Member.
Absent Member.
959 views

Using MapPAth in VisualCObol don't work

Jump to solution

[Migrated content. Thread originally posted on 13 April 2011]

Hi
I can't get the System.Web.HttpContext.Current.Server.MapPath() to work
I got error
I did a work around the Cobol pgm do a
Invok a VB-pgm that dose the MapPath and sen back the path.
But What is the syntax for using MapPath i CObol.
/Conny Lindstrom
System PA
Stockholm
0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Using MapPAth in VisualCObol don't work

Jump to solution
The following works for me in a simple ASP.NET Web Site:


      $set ilusing"System.Web"
       class-id _Default is partial
                 inherits type System.Web.UI.Page.

       working-storage section.
       01 mappath    string.
       method-id Page_Load protected.
       local-storage section.
       procedure division using by value param-sender as object
                                         param-e as type System.EventArgs.
           goback.
       end method.

       method-id Button1_Click protected.
       procedure division using by value lnkSender as object lnkEvent as type System.EventArgs.
           set mappath to type HttpContext::Current::Server::MapPath("/testmappath")
       end method.

       end class.
0 Likes
3 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Using MapPAth in VisualCObol don't work

Jump to solution
The following works for me in a simple ASP.NET Web Site:


      $set ilusing"System.Web"
       class-id _Default is partial
                 inherits type System.Web.UI.Page.

       working-storage section.
       01 mappath    string.
       method-id Page_Load protected.
       local-storage section.
       procedure division using by value param-sender as object
                                         param-e as type System.EventArgs.
           goback.
       end method.

       method-id Button1_Click protected.
       procedure division using by value lnkSender as object lnkEvent as type System.EventArgs.
           set mappath to type HttpContext::Current::Server::MapPath("/testmappath")
       end method.

       end class.
0 Likes
Conny Absent Member.
Absent Member.

RE: Using MapPAth in VisualCObol don't work

Jump to solution
Thanks it works
If you look at VB and try to translate to Cobol it's not easy.

/Conny
0 Likes
Micro Focus Expert
Micro Focus Expert

RE: Using MapPAth in VisualCObol don't work

Jump to solution
It's easier to convert C# to COBOL than VB.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.