Jump to content

Search the Community

Showing results for tags 'read'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Found 4 results

  1. I copied the code straight from https://www.w3schools.com/nodejs/shownodejs_cmd.asp?filename=demo_events_open open.js var fs = require('fs'); var readStream = fs.createReadStream('./demofile.txt'); /*Write to the console when the file is opened:*/ readStream.on('open', function () { console.log('The file is open'); }); Upon executing "node open.js" in the terminal, "The file is open" appears in the terminal, then the program terminates. It always happens, even if I don't have demofile.txt open in Notepad or any other program. Not sure why this is happening? When I instead use the string 'close', the console never prints anything out, regardless as to demofile.txt is open or closed. This behavior has happened on both my Windows machine and Raspberry Pi. Tried putting the above code inside a http.createServer statement, but then I get no output at all in the console. Although I suppose that would be unnecessary.
  2. Hi guys, I need to work with "m³". The function in my script gets a value from a selection. I have 10 seletion options. It works fine with 9 of them, just the "m³" doesnt work. I read something about unicode, but couldn´t find the right one (if it exist für ^3). I also had a look at the w3 js pages (number, math), but that didn´t help too. if (abc == "m³") { var variable = "m³"; document.getElementById('show').innerHTML = variable;} Thanks for your hints, Chrex
  3. Greetings all. I've read the w3schools tutorial on reading rss feeds on blogs One thing I wondered was if there was a similar php example for reading from a forum thread feed http://w3schools.invisionzone.com/index.php?app=core&module=global&section=rss&type=forums&id=2 Any help would be greatly appreciated. Thanks in advance.
  4. Here is a niggling problem I have with an embedded web server.The issue i am having is when I submit my form the form data is submitted to the web server, the web server updates a duel port RAM chip and will then read from that duel port RAM. The problem is the action of reading and writing to the duel port RAM causes a delay in data being passed back to and Web Server.If I write for example the value selected in the option list and submit the form the value is written to the server and when the form reloads it attempt to read the values written from the duel port RAM. The problem is that I always get the previously stored value because the Web server updates quicker than the RAM updates. If I hit the submit button twice the value is read back fine.I put in a breakpoint in the ReadReadBlock but it shows the previous read so I know the problem is due to the slow update from the RAM to the Web server.How can I get around the delay between submitting the form and reading the data back when the form loads.Below is my HTML and Javascript and was hoping that something could give me some pointers.Write to server function is<?--#exec cmd_argument='scanf("parameter", "%u", OutWriteword( 0 ))'-->Read from server function is<?--#exec cmd_argument='printf("%i",InReadUword(44))'-->Many thanks <!DOCTYPE html><head><link rel="stylesheet" type="text/css" href="../css/styles.css" media="screen"><title>BW500</title><script type="text/javascript" src="js/convert.js"></script><script>window.addEventListener('load',ReadReadBlock)</script></head><body><form action="test.html" method="post" id="spa" ><input type="text" id="r_parameter" name="r_parameter"value="<?--#exec cmd_argument='printf("%i",InReadUword(44))'-->"></input><input type="text" id="r_dp" name="r_dp"value="<?--#exec cmd_argument='printf("%i",InReadUword(54))'-->"></input><input type="text" id="r_priindex" name="r_priindex"value="<?--#exec cmd_argument='printf("%i",InReadUword(46))'-->"></input><input type="text" id="r_valueread" name="r_valueread"value="<?--#exec cmd_argument='printf( "%d",InReadUlong(50))'-->"></input><select name="parameter" id="parameter" onChange="WriteWriteBlock()"><option value="911">mA output</option><option value="914">mA input Value</option><option value="918">Speed Frequency</option><option value="940">Load Cell mV</option><option value="943">A/D Reference</option><option value="367">Direct Zero</option><option value="368">Direct Span</option><option value="377">Inital Zero</option><option value="378">Inital Span</option><option value="950">Zero Register</option><option value="951">Span Register</option><option value="341">Days of Service</option><option value="948">Error Log</option></select><select name="pri" id="pri"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="5">5</option></select><input type="hidden" name="dp" id="dp"></input><input type="submit" value="Submit"></input></form><?--#exec cmd_argument='scanf("parameter", "%u", OutWriteword( 0 ))'--><?--#exec cmd_argument='scanf("priindex", "%u", OutWriteword(2))'--><?--#exec cmd_argument='scanf("dp", "%u", OutWriteword(10))'--></body></html> function ReadReadBlock(p,pr,d,value_in){p= document.getElementById('r_parameter').value;pr= document.getElementById('r_priindex').value;d = document.getElementById('r_dp').value;value_in= document.getElementById('r_valueread').value;switch (p){case "911": /mA output/document.getElementById('parameter').selectedIndex = 0;document.getElementById("pri").disabled = false;document.getElementById("r_dp").value = 2;d=2;break;case "914": /mA input/document.getElementById('parameter').selectedIndex = 1;document.getElementById("pri").disabled = false;document.getElementById("r_dp").value = 2;d=2;break;case "918": /Speed Input/document.getElementById('parameter').selectedIndex = 2;document.getElementById("pri").disabled = false;document.getElementById("r_dp").value =2;d=2;break;case "940":/Loadcell mV/document.getElementById('parameter').selectedIndex = 3;document.getElementById("pri").disabled = false;document.getElementById("r_dp").value = 2;d=2;break;case "943": /AD Referonce/document.getElementById('parameter').selectedIndex = 4;document.getElementById("pri").disabled = false;document.getElementById("r_dp").value = 0;d=0;break;case "367": /Direct Zero/document.getElementById('parameter').selectedIndex = 5;document.getElementById("pri").disabled = true;document.getElementById("r_dp").value = 0;d=0;break;case "368":/Direct Span/document.getElementById('parameter').selectedIndex = 6;document.getElementById("pri").disabled = false;document.getElementById("r_dp").value = 0;d=0;break;case "377": /Inital Zero/document.getElementById('parameter').selectedIndex = 7;document.getElementById("pri").disabled = false;document.getElementById("r_dp").value = 0;d=0;break;case "378":/Inital Span/document.getElementById('parameter').selectedIndex = 8;document.getElementById("pri").disabled = false;document.getElementById("r_dp").value = 0;d=0;break;case "950": /Zero Register/document.getElementById('parameter').selectedIndex = 9;document.getElementById("pri").disabled = false;document.getElementById("r_dp").value = 0;d=0;break;case "951":/Span Register/document.getElementById('parameter').selectedIndex = 10;document.getElementById("pri").disabled = false;document.getElementById("r_dp").value = 0;d=0;break;case "341": /Days of Service/document.getElementById('parameter').selectedIndex = 11;document.getElementById("pri").disabled = true;document.getElementById("r_dp").value = 0;d=0;break;case "948": /error log/document.getElementById('parameter').selectedIndex = 12;document.getElementById("pri").disabled =false;document.getElementById("r_dp").value = 0;d=0;break;}switch (d){case 0:document.getElementById("r_valueread").value=value_in;break;case 1:document.getElementById("r_valueread").value=value_in/10;break;case 2:document.getElementById("r_valueread").value=value_in/100;break;case 3:document.getElementById("r_valueread").value=value_in/1000;break;}}
  • Create New...