Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 8th, 2005, 05:59 AM
maxx007at maxx007at is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 3 maxx007at User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 15 m 36 sec
Reputation Power: 0
Question <Identifier> expected

I'm new to JAVA.

I have made the following code:
Code:
   1 import com.sun.rsasign.m;
   2 import com.sun.rsasign.p;
   3 import Class.com.sun.star.uno.UnoRuntime;
   4 import Class.com.sun.star.text.XTextDocument;
   5 import Class.com.sun.star.text.XText;
   6 import Class.com.sun.star.text.XTextRange;
   7 import Class.com.sun.star.frame.XStorable;
   8 import Class.com.sun.star.beans.PropertyValue;
   9 /* 
   10 * PropertyValue.java
        11 *
        12 * Created on June 7, 2005, 4:05 PM
        13 */
       14
  15 /**
  16 *
  17 * @author  msl
  18 */
       19 public class StoreToURL {
       20    
       21    /** Creates new form BeanForm */
  22    public StoreToURL() {
       23 	   initComponents();
       24 	   
       25    }
       26    public class main{	
  27      /** Methods available are: 
  28 *
  29 *XSCRIPTCONTEXT.getDocument()   returns XModel
  30 *   XSCRIPTCONTEXT.getDesktop() returns XDesktop
         31 *XSCRIPTCONTEXT.getComponentContext() returns XComponentContext
  32 */ 
       33
  34 Dim oDoc = XSCRIPTCONTEXT.getDocument();
  35 Dim xTextDoc = UnoRuntime.queryInterface(XTextDocument,oDoc);
  36 Dim xText = xTextDoc.getText();
  37 Dim xTextRange; As String;
       38 String xTextRange = xText.getStart();
  39 xTextRange.setString( "Text created by Martijn Slippens.\n\n" );
       40 String xTextRange = xText.getEnd();
  41 xTextRange.setString( "All rights reserved®.\n\n" );
  42 Dim sPath = "path:///D:/BASIC";
  43 Dim sURL  = sPath & "/" & "test.odt";
       44 Dim xDocument = oDoc;
       45
       46 {
       47
       48 com.sun.star.beans.PropertyValue[] lProperties = 
       49 new com.sun.star.beans.PropertyValue[1];
  50 lProperties[0] = new com.sun.star.beans.PropertyValue() ;
       51 lProperties[0].Name  = "Overwrite ";
       52 lProperties[0].Value = new Boolean(true);
       53
       54
       55    com.sun.star.frame.XStorable xStore = (com.sun.star.frame.XStorable)UnoRuntime.queryInterface (
       56
       57 	 com.sun.star.frame.XStorable .class, xDocument);
       58
  59        xStore.storeAsURL (sURL, lProperties);
  60 }
       61
       62    }
  63    /** This method is called from within the constructor to
  64 	* initialize the form.
       65 	* WARNING: Do NOT modify this code. The content of this method is
        66 	* always regenerated by the Form Editor.
       67 	*/
       68    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">	  				   
       69    private void initComponents() {
       70
       71    }
       72    // </editor-fold>					 
       73    
       74   
    75 // Variables declaration - do not modify					 
       76    // End of variables declaration				   
       77    
  78 }
   79
  


But the lines:

Code:
39 xTextRange.setString( "Text created by Martijn Slippens.\n\n" );


&

Code:
41 xTextRange.setString( "All rights reserved®.\n\n" );


give the following error:

<Identifier> expected.

Could someone please tell me what it is that i must change in order to make it work?

Thanx in advance.



Reply With Quote
  #2  
Old June 8th, 2005, 09:23 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,886 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 19 m 35 sec
Reputation Power: 18
What type of java is this?

Don't usually see Dim in java.

Reply With Quote
  #3  
Old June 9th, 2005, 03:13 AM
maxx007at maxx007at is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 3 maxx007at User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 15 m 36 sec
Reputation Power: 0
This is NetbeansJAVA. just the JAVA editor/compiler/debugger that is recommended to use with OOo.

Reply With Quote
  #4  
Old June 9th, 2005, 10:34 AM
maxx007at maxx007at is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 3 maxx007at User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 15 m 36 sec
Reputation Power: 0
And it is a script made for OOo (OpenOffice.Org). I suppose you know what Dim stands for

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > <Identifier> expected


Developer Shed Advertisers and Affiliates


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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap