Vbscript variabele opvragen in JavaScript?

Pagina: 1
Acties:

  • BtM909
  • Registratie: Juni 2000
  • Niet online

BtM909

Watch out Guys...

Topicstarter
Ik heb een probleem met een offline applicatie. Er is een functie gedefinieerd met JavaScript. Deze functie roept op een bepaald moment een vbscript aan.

In dit VBScript worden handelingen uitgevoerd en in een variabele geplaatst.

Is het mogelijk om deze variabel uit te lezen met Javascript (en dan specifiek door de functie die de VB-functie aanriep)??

Alvast bedankt!

Ace of Base vs Charli XCX - All That She Boom Claps (RMT) | Clean Bandit vs Galantis - I'd Rather Be You (RMT)
You've moved up on my notch-list. You have 1 notch
I have a black belt in Kung Flu.


  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

code ?

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz


  • BtM909
  • Registratie: Juni 2000
  • Niet online

BtM909

Watch out Guys...

Topicstarter
komt ie:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//vbscript
function afsdatum()
 dim afsdtm
 dim ajaar
 dim adag
 dim amaand
 dim afspraakdatum
 adag = Day(DateTimePickerX1.date)
 amaand = Month(DateTimePickerX1.date)
 ajaar = Year(DateTimePickerX1.date)

 afsdtm = adag & "/" & amaand & "/" & ajaar & " " & cboTime.value
 afspraakdatum = afsdtm
end function

//JavaScript
function doSchedule()
{    
   var afspraakdatum 
    afsdatum()
    alert(afspraakdatum)
}

Als ik een alert weergeef met de variabele DateTimePickerX1.date (Kalender-object) dan krijg ik een datum die geconverteerd is naar een getal! Door middel van VBscript heb ik een datum samengesteld en deze wil ik uitlezen met JavaScript.

Kan dit?

Ace of Base vs Charli XCX - All That She Boom Claps (RMT) | Clean Bandit vs Galantis - I'd Rather Be You (RMT)
You've moved up on my notch-list. You have 1 notch
I have a black belt in Kung Flu.


  • RM-rf
  • Registratie: September 2000
  • Laatst online: 11:53

RM-rf

1 2 3 4 5 7 6 8 9

misschien met het VBArray object?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/js56jsobjvbarray.asp

of in ieder geval kan die link je verder helpen: de getItem en bound functions e.d.

Intelligente mensen zoeken in tijden van crisis naar oplossingen, Idioten zoeken dan schuldigen


  • BtM909
  • Registratie: Juni 2000
  • Niet online

BtM909

Watch out Guys...

Topicstarter
ik heb het al opgelost!

//vbscript
function afsdatum()
dim afsdtm
dim ajaar
dim adag
dim amaand
adag = Day(DateTimePickerX1.date)
amaand = Month(DateTimePickerX1.date)
ajaar = Year(DateTimePickerX1.date)
afsdtm = adag & "/" & amaand & "/" & ajaar & " " & cboTime.value
afsdatum = afsdtm
end function

//JavaScript
function doSchedule()
{
alert(afsdatum());
}

In VBscript return je een waarde, door de nodige variabele in een variabele te plaatsen die dezelfde naam heeft als de functie!

In ieder geval bedankt!

Ace of Base vs Charli XCX - All That She Boom Claps (RMT) | Clean Bandit vs Galantis - I'd Rather Be You (RMT)
You've moved up on my notch-list. You have 1 notch
I have a black belt in Kung Flu.