Click here to Skip to main content
15,890,438 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: finds number of balls to overs Pin
OriginalGriff24-Jul-18 19:29
mveOriginalGriff24-Jul-18 19:29 
QuestionRe: finds number of balls to overs Pin
ZurdoDev7-Aug-18 4:46
professionalZurdoDev7-Aug-18 4:46 
QuestionNPM dependency madness Pin
Mel Padden19-Jul-18 5:48
Mel Padden19-Jul-18 5:48 
AnswerRe: NPM dependency madness Pin
ZurdoDev7-Aug-18 4:46
professionalZurdoDev7-Aug-18 4:46 
AnswerRe: NPM dependency madness Pin
jkirkerx17-Aug-18 12:43
professionaljkirkerx17-Aug-18 12:43 
QuestionUpdate Google chart with dynamic data. Pin
Gopi24718-Jul-18 3:48
Gopi24718-Jul-18 3:48 
AnswerRe: Update Google chart with dynamic data. Pin
ZurdoDev7-Aug-18 4:47
professionalZurdoDev7-Aug-18 4:47 
QuestionIssue With JavaScript and ClearScript Pin
Alan Burkhart13-Jul-18 13:10
Alan Burkhart13-Jul-18 13:10 
I'm learning to script an application with ClearScript. My program is a tabbed text editor and the idea is to have access to all the open files via a List. For scripting, the program opens a separate window (so that the script is not part of the scriptable collection). Results are written to a second textbox. And there is where I discovered the problem. At present I'm just having the Javascript display the "FilePath" property of each item in the collection. This works fine with this script:

JavaScript
parent.OutPut.Text="";
var i;
var y=0;
for (i = 0; i < parent.OpenFiles.Count; i++) {
    y += 1
    parent.OutPut.Text += y + " " + parent.OpenFiles[i].FilePath + "\r\n";
    
}
parent.OutPut.Text += parent.OpenFiles.Count;


I get the following correct result in the textbox:

1 C:\Users\Alan\Documents\Transfer\From Toshiba\Projects\alanburkhart.com\WikipediaCrimeData_RawText.txt
2 C:\Users\Alan\Documents\Transfer\From Toshiba\Projects\alanburkhart.com\conspiracytheory.html
3 C:\Users\Alan\Documents\Transfer\From Toshiba\Projects\alanburkhart.com\USConsSearch.html
4 C:\Users\Alan\Documents\Transfer\From Toshiba\Projects\alanburkhart.com\wordley.html
5 C:\Users\Alan\Documents\new 1.txt
6 C:\Users\Alan\Documents\10Comms.txt
7 C:\Users\Alan\Documents\testfile.txt
8 C:\Users\Alan\Documents\Transfer\From Toshiba\TestSpellChecker.txt
9 C:\Users\Alan\Documents\Projects\NetPadd2 Help Files\AdntlRsc.html
10 C:\Users\Alan\Documents\Projects\NetPadd2 Help Files\intro.html
11 C:\Users\Alan\Documents\ForLoop.js
12 untitled_2.txt
13 C:\Users\Alan\Documents\ForEach.js
13

("13" is the number of items in the collection.)

However, if I use this script:
JavaScript
parent.OutPut.Text="";
var x;
var i=0
for (x in parent.OpenFiles) {
i+=1
parent.OutPut.Text += i + " " + parent.OpenFiles[x].FilePath + "\r\n";}
parent.OutPut.Text += parent.OpenFiles.Count;


I get the following result:
1 C:\Users\Alan\Documents\Transfer\From Toshiba\Projects\alanburkhart.com\WikipediaCrimeData_RawText.txt
2 C:\Users\Alan\Documents\Transfer\From Toshiba\Projects\alanburkhart.com\conspiracytheory.html
3 C:\Users\Alan\Documents\Transfer\From Toshiba\Projects\alanburkhart.com\USConsSearch.html
4 C:\Users\Alan\Documents\Transfer\From Toshiba\Projects\alanburkhart.com\wordley.html
5 C:\Users\Alan\Documents\new 1.txt
6 C:\Users\Alan\Documents\10Comms.txt
7 C:\Users\Alan\Documents\testfile.txt
8 C:\Users\Alan\Documents\Transfer\From Toshiba\TestSpellChecker.txt
9 C:\Users\Alan\Documents\Projects\NetPadd2 Help Files\AdntlRsc.html
10 C:\Users\Alan\Documents\Projects\NetPadd2 Help Files\intro.html
11 C:\Users\Alan\Documents\ForLoop.js
12 undefined
13 undefined
14 undefined
15 undefined
16 undefined
17 undefined
18 undefined
19 undefined
20 undefined
21 undefined
22 undefined
23 undefined
24 undefined
25 undefined
26 undefined
27 undefined
28 undefined
29 undefined
30 undefined
31 undefined
32 undefined
33 undefined
34 undefined
35 undefined
36 undefined
37 undefined
38 undefined
39 undefined
40 undefined
41 undefined
42 undefined
43 undefined
44 undefined
45 undefined
46 undefined
47 undefined
48 undefined
11

The number of "undefined" remains at 37 no matter how many open files I have. I'm not an expert with JavaScript although I usually can write a script that works. Can anyone give me an idea what is causing this? I'm stumped. I've been using this text editor a couple of years without issue (it's one I wrote for my own use) and I don't see a reason for the problem in my VB code. Is it the JS code? Any ideas are appreciated.
Sometimes the true reward for completing a task is not the money, but instead the satisfaction of a job well done. But it's usually the money.

AnswerRe: Issue With JavaScript and ClearScript Pin
Graham Breach14-Jul-18 2:07
Graham Breach14-Jul-18 2:07 
GeneralRe: Issue With JavaScript and ClearScript Pin
Alan Burkhart14-Jul-18 3:49
Alan Burkhart14-Jul-18 3:49 
QuestionJavaScript Pin
Member 99702028-Jul-18 20:15
Member 99702028-Jul-18 20:15 
AnswerRe: JavaScript Pin
Member 997020210-Jul-18 4:44
Member 997020210-Jul-18 4:44 
QuestionNeed some help with app, please. Pin
Member 1388357522-Jun-18 12:03
Member 1388357522-Jun-18 12:03 
AnswerRe: Need some help with app, please. Pin
Nathan Minier25-Jun-18 1:49
professionalNathan Minier25-Jun-18 1:49 
QuestionCreating hexbins visualisation with mapbox in an angular 4 project Pin
Member 1387271014-Jun-18 2:35
Member 1387271014-Jun-18 2:35 
QuestionJavascript function - onclick problem Pin
Member 201089711-Jun-18 16:23
Member 201089711-Jun-18 16:23 
AnswerRe: Javascript function - onclick problem Pin
Member 1387615717-Jun-18 19:57
Member 1387615717-Jun-18 19:57 
GeneralRe: Javascript function - onclick problem Pin
Richard MacCutchan17-Jun-18 21:49
mveRichard MacCutchan17-Jun-18 21:49 
Questionnot work onClick operation Pin
Member 1382834015-May-18 6:29
Member 1382834015-May-18 6:29 
SuggestionRe: not work onClick operation Pin
Richard Deeming15-May-18 9:10
mveRichard Deeming15-May-18 9:10 
GeneralRe: not work onClick operation Pin
Shivnandan singh25-May-18 0:31
Shivnandan singh25-May-18 0:31 
AnswerRe: not work onClick operation Pin
Shivnandan singh25-May-18 0:32
Shivnandan singh25-May-18 0:32 
GeneralCall jquery function after partial view page return. Pin
Rahulgupta.hanu14-May-18 3:28
Rahulgupta.hanu14-May-18 3:28 
GeneralRe: Call jquery function after partial view page return. Pin
CP_Member88829-Jul-18 19:32
CP_Member88829-Jul-18 19:32 
QuestionJava script and SQL Pin
Johannes Moolman7-May-18 23:04
Johannes Moolman7-May-18 23:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.