WAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreWAP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old October 5th, 2004, 11:42 AM
solanki18 solanki18 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 1 solanki18 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
problem with wmlscript(i think)

Hi,

I am very new to wap programming and i am reading through Beginning WAP, WML & WMLScript by Wrox. One of the exercises is to implement a simple calculator function which adds together 2 integers keyed in by the user. The code below i know is right, because its supplied in the book. When te appliation is executed, it allows the user to type in 2 integers but when i press the calculate option i get an error. What i cant seen to do is get the WMLScript to work. I have added the following MIME types to IIS default web server:

text/vnd.wap.wml
application/vnd.wap.wmlc
text/vnd.wap.wmlscript
application/vnd.wap.wmlscriptc

I thought by adding the above MIME types would solve my problem but it didn't. The two emulators i am using are Openwave SDK 6.2.2 and M3Gate. I really do not know whats wrong with it. Here is the code.

calc.wml
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml_1.2.xml">

<wml>
<card id="add" title="Add 2 Numbers">
<p>This is a simple calculator.</p>
<p>
Please enter the first number<br/>
X = <input name="var1" title="1st number" format="*N" /><br/>
Please enter the second number<br/>
Y = <input name="var2" title="2nd number" format="*N" /><br/>
<a href="calc.wmls#add($(var1), $(var2))">Calculator</a>
</p>
<do type="accept">
<go href="calc.wmls#add($(var1), $(var2))"/>
</do>
</card>

<card id="answer" title="Result">
<p>X + Y = $(S)<br/></p>
</card>
</wml>

and here is the code for calc.wmls
extern function add(a, b)
{
WMLBrowser.setVar("S", a + b);
WMLBrowser.go("#answer");

}

I would very much appreciate any help. I cant really go through the rest of the book until i solve this problem.

Thankyou

solanki18

Reply With Quote
  #2  
Old October 26th, 2004, 09:25 AM
flyinghigh flyinghigh is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 47 flyinghigh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 15 m 12 sec
Reputation Power: 4
The code worked correctly on my computer.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > problem with wmlscript(i think)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway