Jump to content

crazyswede

Members
  • Content Count

    53
  • Joined

  • Last visited

Community Reputation

3 Neutral

About crazyswede

  • Rank
    Newbie
  • Birthday 03/02/1955

Contact Methods

  • AIM
    robchristiansen2@gmail.com
  • Website URL
    http://ccs2468.com/

Profile Information

  • Location
    Seattle

Previous Fields

  • Languages
    BASIC, C, C++, HTML, ASP
  1. crazyswede

    working with session

    I’m Working with classic asp. Great! 😀 Can you help me out with an address where I can study console()? I apparently don't know how to do this. I Google Console() and I get a bunch of links. I click a link and I just get more likes. Click again and I just get more links. . . And on and on and on.
  2. crazyswede

    working with session

    This is very frustrating. Using session I can store variables in the computer, and then recover them in the new instance Without having to pass them through the URL. But at that point it appears that I can only print the value of the variables, whereas I need to load that value into a variable that I can then manipulate and work with. W3schools help page Specifically shows that can be done., but it does not work for me. Is there something I'm doing wrong? ---------------------------------- ExistContents = "Exist"; newContents= "new"; %> <div id="result1"></div> <script> sessionStorage.setItem( "ExistContents", "<%Response.Write( ExistContents )%>" ) </script> <div id="result2"></div> <script> sessionStorage.setItem( "newContents", "<%Response.Write( newContents )%>" ) </script> <input type=hidden name= "to_do" value= "WriteEdit" > <input type="submit" value="Submit"> <% } //23 if( to_do == "WriteEdit" ) { //100 %> <div id="result1"></div> <script> document.getElementById("result1").innerHTML = sessionStorage.getItem("ExistContents"); </script> <div id="result2"></div> <script> document.getElementById("result2").innerHTML = sessionStorage.getItem("newContents"); </script> [So far all works great!] <div id="result1"></div> <script> var file1 = sessionStorage.getItem("ExistContents" ) <--- W3schools help page Specifically shows that can be done., but it does not work for me. Down below I print the value of file1, but I get undeclared identifier. 😩 </script> <div id="result2"></div> <script> var file2 = String( sessionStorage.getItem( "newContents" ) ) <-- I tried something else, here, which didn't work either </script> <% Response.Write( "file1= "+ file1 +"<br>" ) Response.Write("file2= "+ file2 +"<br>" )
  3. crazyswede

    Modifying the value of a global variable

    It's good to hear this should work. I have had the most success with this code - //--- try 4 -- ------------- ExistContents= “existing”; <textarea cols=100 rows=20 > <script> localStorage.setItem("NewContents",<%Response.Write( ExistContents ) %> ) </script> </textarea > <br> //------------------ <textarea> works fine, but then it prints out the localStorage command as though it were text, instead of Executing it. So then I tried this - //--- try 5 -- ------------- ExistContents= “existing”; <textarea cols=100 rows=20 > <%Response.Write( <script> localStorage.setItem( "NewContents", "ExistContents" ) </script> ) %> </textarea > <br> //------------------ . . . But that works no better.
  4. crazyswede

    Modifying the value of a global variable

    Got it.! I incorporated the <session> into an asp program, two if-blocks (I call those “instances”). In the first block I assign a value to my variable - (ExistingContents = “existing”). Using session object I then file that variable away in the computer. After clicking submit, the second block extracts the value and prints it - A simple little program that doesn't really do anything. At least I now know it can be done. What I need is to be able to edit the contents of “ExistingContents” with my keyboard And then have session file it away in the computer. In the past I've done this using <textarea>. I have tried for hours and hours and hours to figure out a way to Mix <textarea> with <session>, but with no luck. If I keep them separate, then one works but the other doesn't. I'm Wondering, Maybe I'm using the wrong functions. Is there possibly a different function or set of functions that would do these two operations without screwing each other up?
  5. crazyswede

    Modifying the value of a global variable

    I have a program right now that reads a file off my computer into <textarea>, I modify it, and then pass it all to another if-block, that then writes it all back to the file. And that works. The problem arises when I try to pass too much data. I calculate that I can pass 250 characters - any more and the program will crash. What if I have a file with several thousand characters? I thought maybe if I make my variable global, I could avoid the matter of passing anything. Global variables though are very frustrating, no one will help me, and I haven't got the time to screw around with this thing. So I was looking into “textarea,” Apparently, after I click submit, it seems that I can tell The computer to write everything to the file. Is that correct? In another program I can then open that file, get the data out, and write it all to the file. Below are the two programs. The second program, I just print the contents of the file - but I get FILE NOT FOUND. please what am I doing wrong? ------------ testpass.htm -------------- <!DOCTYPE html> <html> <body> <form action="/action_page.php"> Text:<br> <textarea name="explanation"dirname="explanation.dir"></textarea> <input type="submit" value="Submit"> </form> <p>When the form is being submitted, the text direction of the textarea will also be submitted.</p> </body> </html> ------------ testpass.asp -------------- <%@ Language=JavaScript %> <% var URLname = "E:\\web\\ccs2468com0\\htdocs\\action_page.php"; var ForReading = 1, ForWriting = 2, ForAppending = 8; var abs_path = String(Request.ServerVariables("PATH_TRANSLATED")); var file_to_open = URLname ; fso = new ActiveXObject("Scripting.FileSystemObject"); ; //<--FILE NOT FOUND fs_stream = fso.OpenTextFile (file_to_open, ForReading ) ExistContents = fs_stream.ReadAll(); //fs_stream.Write( MemoContents +" \r\n" ); fs_stream.close(); Response.Write( "ExistContents= "+ ExistContents +"<br>" ); ; %>
  6. crazyswede

    having trouble navigating your website.

    Okay, I think I got a lot of that figured out. What I need to know about, is session. I can't find any listing for that in the reference . . . https://www.w3schools.com/jsref/default.asp I go on Google and type session and that tells me a little something .
  7. I seem to be having trouble navigating your website. I want to find information about a specific topic - for example Session, Object, File management, etc. In the past I would simply go your website, type in a few keywords into the search engine, and it would give me all the information I would need to know. Now I do that and it says CANNOT FIND. Could someone please help me? Where can I read the instructions on this? 😥
  8. crazyswede

    Modifying the value of a global variable

    It sure is a good thing you're there to help me with these things! I would never have known about sessions. So Below is what I found on the web - I get nothing but a blank screen, no errors, just a blank screen. It should print the value of sessions, shouldn’t it - “ID” and “code?” Can you tell me what I'm doing wrong? ----------------- testSession.asp ---------- <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% Session("id")=1234 Session("code")="ZZ" %> ----------------- testSession.htm (this is what I run) ---------- <html> <head></head> <body> <script type="text/javascript" src="asp/testSession.asp"> alert("Session ID " + Session("id")); </script> </body>
  9. crazyswede

    Javascript command for finish the program

    Response.End();
  10. crazyswede

    Modifying the value of a global variable

    The below is the full, working code. You can copy and paste and run it, or you can run it on my website - http://ccs2468.com/msc/genesis.test.asp?to_do=EditEntry -------------------------------------------------------- <%@ Language=JavaScript %> <HTML> <HEAD> <TITLE>Genesis.test.asp?to_do=EditEntry</TITLE> </HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080"> <form action= "<% = this_script_url %>" > <% var this_script_url = String( Request.ServerVariables("SCRIPT_NAME")); var to_do = String( Request.QueryString( "to_do" ) ); var datamessage = "global";;//<--- I ESTABLISH THE GLOBAL VARIABLES Recnum=1 if( to_do == "EditEntry" ) { //33 Response.Write( “before modify ”+ Recnum +") datamessage "+ datamessage +" <br>" ); //<--datamessage= “global”, Recnum= 1, like it should be datamessage = "pppppppppppppppp"; //←- It apparently doesn't know there is a global variable by the same name, so it creates a new local variable, while the global one remains unchanged. Recnum = 37; //<-- I change the value of a global integer as well, although it doesn't matter, it's the same. String or integer, it doesn't matter. Response.Write( “after modify ”+ Recnum +") datamessage = "+ datamessage +" <br>" ); //← these are the values of the local variables, while the global ones remain unchanged. %> <FONT size =6 FACE="Copperplate Gothic Bold" <P ALIGN="center" ><B>Edit List</B><br> <FONT size=5 FACE="Times New Roman" > <p> <textarea cols=100 rows=20 > <%Response.Write( datamessage ) %> </textarea ><br> <input type=hidden name="to_do" value= "WriteEntry"> <input type=submit value="Save"> <% } //33 if( to_do == "WriteEntry" ) { //24B Response.Write( “in WriteEntry datamessage = "+ datamessage +" <br>" ); Response.Write( “in WriteEntry Recnum = "+ Recnum +" <br>" ); //← ....global variables remain unchanged. } //24B %> </BODY></HTML>
  11. classic ASP - javascript ------------------------------- var datamessage = "global"; [<--- I ESTABLISH THE GLOBAL VARIABLE] aaa=10; recnum=1 if( to_do == "EditEntry" ) { //33 Response.Write( “before”+ recnum +") datamessage = ["+ datamessage +"] <br>" ); [<-- “global”] datamessage = "pppppppppppppppp"; Recnum = 37; [ It apparently doesn't know there is a global variable by the same name, so it creates a new local variable, while the global one remains unchanged. String or integer, it doesn't matter. ] Response.Write( “after”+ recnum +") datamessage = ["+ datamessage +"] <br>" ); <input type=hidden name="to_do" value= "WriteEntry"> <input type=submit value="Save"> } //33 if( to_do == "WriteEntry" ) { //24B Response.Write( “WriteEntry ”+ recnum +") datamessage = ["+ datamessage +"] <br>" ); [....global variables remain unchanged. Please, how can I fix this? .... ] } //24B
  12. crazyswede

    build a command

    var ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" + AbsolutePathToAccessFile + ";"; var ConnectionObject = Server.CreateObject("ADODB.Connection"); ConnectionObject.Open( ConnectionString ); var sql = "SELECT * FROM santa1 "; var rs = Server.CreateObject("ADODB.RecordSet"); rs.Open (sql, ConnectionObject); fff = GetFieldToRead( databasename ); --------------------------------- My program reads an *.mdb file----> SantaName = rs("man1").Value But it changes every month - February= rs("man2").Value, march= rs("man3").Value, and so forth. I could and have used if-statements, but I want to learn how to build or customize that command. Would it be like you build a string? - = "rs(/""+ fff +"/").Value)", where fff signifies man1 or man2 or man3, etc. Just point me in the right direction and I'll study it.
  13. crazyswede

    #INCLUDE FILE in another directory

    I'm done typing
  14. crazyswede

    #include file paths

    Sorry, I've tried everything. This is really friggen frustrating!!! All I can say is please see my webpage - ccs2468.com/aspquestion.txt
  15. crazyswede

    #include file paths

    Copy and paste on this page doesn't work. So see attachment ... or http://ccs2468.com/aspquestion.txt aspquestion.txt
×