Java script for foxpro developers

2,523 views
2,156 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,523
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
16
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Java script for foxpro developers

  1. 1. JavaScript for FoxPro Developers Mike Feltman F1 Technologies
  2. 2. Who Am I?• President F1 Technologies since 1990• Co-author Visual FoxExpress• Consultant
  3. 3. Agenda• Why JavaScript?• VFP vs. JavaScript• JS Basics• JS Syntax & VFP Concordance• JS OOP• AJAX w/ VFP
  4. 4. Why JavaScript?• Web 2.0• Great way to take VFP Skills to the Web• In demand• Cross-Platform• Relatively easy for VFP Developers to pick up
  5. 5. VFP vs. JavaScript: Runtime EnvironmentVFP JavaScript – Operating System: – Operating System: • Windows • Windows, MAC, Linux, Version: Unix, etc. • VFP Compiler Version Version: • Browser Controlled: IE, Firefox, Opera, Safari, etc. • 1.5 current “standard”
  6. 6. VFP vs. JavaScript: Development EnvironmentVFP JavaScript – Designers: Editor, Form – Designers: n/a, Requires 3rd Class Designer, Report Party tools. No definitive Write, Class Browser, etc. IDE built-in. – Debugger: virtually nothing – Debugger: Integrated native. Varies by browser, debugger, with Trace, Firebug for Firefox and Watch, Locals, Output, Call Debugbar for IE. Stack – JavaScript Console various – Command Window other Command Window like utilities.
  7. 7. VFP vs. JavaScript: CapabilitiesVFP JavaScript – Access to File System – No File System – Database Engine Access – Network access – Can’t read or write to limited only by network files on server security – Can’t read or write to files on client – No network access – Cannot access pages on another domain
  8. 8. VFP vs. JavaScript: Language FeaturesVFP JavaScript – Dynamically Typed – Dynamically Typed – Case Insensitive – Case Sensitive – “Second Class” – First Class Functions Functions – Nested Functions – No Nested Functions – Interpreted – Compiled or – OOP: Prototype based Interpreted – “0 based” – OOP: Class Based – “1 based”
  9. 9. SyntaxVFP JavaScript – Line Terminator: – Line Terminator: semi- carriage return colon – Line Continuation: – Line Continuation: n/a semi-colon
  10. 10. Math OperatorsFunction VFP JavaScriptAddition + +Subtraction - -Multiplication * *Division / /Modulus MOD() %Unary addition x=x+1 x++Unary x=x-1 x--subtraction
  11. 11. Assignment OperatorsFunction VFP JavaScriptEquality = =Addition n/a +=Subtraction n/a -=Multiplication n/a *=Division n/a /=Modulus n/a %=
  12. 12. Comparison OperatorsFunction VFP JavaScriptEquality =,== ==Greater than >, >= >, >=Less Than <, <= <, <=Identical & of n/a ===Same TypeNot Identical !=,!==,<> !==Inline IF IIF() (condition)?true value: false value
  13. 13. Logical OperatorsFunction VFP JavaScriptAnd AND &&Or OR ||Not NOT, ! !
  14. 14. Constructs: IfVFP: JavaScript:IF if (logical expression) statement(s) {statement(s)}ELSE else if (logical statement(s) expression)ENDIF {statements} else {statement(s)}
  15. 15. Constructs: WhileVFP JavaScript DO WHILE expression while (expression) statements { ENDDO statements } EXIT break LOOP continue
  16. 16. Constructs: ForVFP JavaScript FOR var = n to n STEP n for statements (var=startvalue;var<= ENDFOR endvalue;var=var+inc rement) { statements }
  17. 17. Object Model
  18. 18. Event Model
  19. 19. Forms
  20. 20. 3 Party rd

×