Forums

Creating A Project in Cobra

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Creating A Project in Cobra

Postby wrechtin » Sat Jan 12, 2013 9:26 pm

Hi.

I'm brand new to programming. I've installed Cobra on my system, but I have been unable to get either IDE (Visual Studios and MonoDevelop) to recognize it. I've been trying to use the command line from the Monodevelop add-in website (please see attached), but have not been successful. Can anyone point me in the right direction on this? Thanks.
Attachments
Cobra.png
Cobra.png (42.32 KiB) Viewed 8461 times
wrechtin
 
Posts: 4

Re: Creating A Project in Cobra

Postby DelphiGuy » Sun Jan 13, 2013 10:07 am

What command prompt window are you using, please? (From where did you launch the command window?)

Did you set administrator rights for that command window (nerdzero, is that necessary for this particular command)?

What is the exact feedback you got from trying to run that command?
DelphiGuy
 
Posts: 116

Re: Creating A Project in Cobra

Postby nerdzero » Sun Jan 13, 2013 11:15 am

For the MonoDevelop addin, if you're on Windows 64-bit, you should start from the "Additional Requirements for Windows 7 64-bit" section. Make sure you use a Visual Studio command prompt or a Windows SDK prompt to execute the gacutil command and yes you do need to run as an administrator since you will be removing and adding things to/from the GAC.

Like DelphiGuy was saying, it will be easier to help if you can give more information about what command you tried and what error message you got back.

As for Visual Studio, Matthew Strawbridge can be more help on that one. I believe it can be easily installed from the Extension Manager but only for VS 2010.
nerdzero
 
Posts: 286
Location: Chicago, IL

Re: Creating A Project in Cobra

Postby ObtuseAngle » Sun Jan 13, 2013 6:24 pm

A little off-topic, but something to remember: while IDEs are useful they are not essential for Cobra programming.
Don't get hung up shaving a yak rather than programming.

Spend a couple of minutes setting your favourite text editor to use Python syntax highlighting (as a starting point) and run the Cobra command line and you're ready to program. You can still set up an IDE at your leisure as a separate project, but don't make it a pre-condition for your programming.

My personal favourite text editor is SciTE. Admittedly, I've customised it a bit via settings and Lua scripts.

For a better starting editor (more gentle modification of settings through a GUI rather than SciTE's somewhat recondite configuration files) I recommend Programmer's Notepad.
Go into Tools > Options > Files and add .cobra files to use the Python scheme (later you can create a custom Cobra Scheme).
Tools > Options > Tools and set it up under the Python scheme to run Cobra on your source file.

Later you can look at Programmer's Notepad settings on the Cobra Wiki.


Programmer's Notepad, with code folding, Python syntax highlighting, a few other options tweaked:
Image

SciTE with code folding, custom syntax highlighting, and custom (in-file) autocomplete (via Lua script):
Image
99 programming bugs in the code, 99 bugs in the code, fix 1 bug and compile it again, 101 programming bugs in the code
ObtuseAngle
 
Posts: 42
Location: Gippsland, Australia

Re: Creating A Project in Cobra

Postby wrechtin » Mon Jan 14, 2013 6:16 pm

Hi DelphiGuy,

DelphiGuy wrote:What command prompt window are you using, please? (From where did you launch the command window?)

Did you set administrator rights for that command window (nerdzero, is that necessary for this particular command)?

What is the exact feedback you got from trying to run that command?


Sorry about that. I've tried it running both Visual Studios Command Prompt and Windows Command Prompt as an administrator. The exact error message I'm getting back is " 'cobra' is not recognized as an internal or external command, operable program or batch file." However, I was successful in implementing the commands for "Additional Requirements for Windows 7 64-bit".
wrechtin
 
Posts: 4

Re: Creating A Project in Cobra

Postby nerdzero » Mon Jan 14, 2013 6:31 pm

This most likely means that either the cobra command is not in your PATH environment variable or Cobra is not installed.

Before you tried the Cobra addin for MonoDevelop, were you able to use Cobra from the command line to compile and run Cobra programs? If you're not sure if you have Cobra installed correctly, check to see if you have a 'C:\Cobra\bin\cobra.bat' file.
nerdzero
 
Posts: 286
Location: Chicago, IL

Re: Creating A Project in Cobra

Postby wrechtin » Thu Jan 17, 2013 6:56 pm

Hi nerdzero,

Thanks for the response. I do have a 'C:\Cobra\bin\cobra.bat' file. However, like I said I'm brand new to programming. I don't know how to use Cobra from the command line to compile and run Cobra programs. Do you care to explain or know where I can find beginner information for this?

Thanks,
Will

nerdzero wrote:This most likely means that either the cobra command is not in your PATH environment variable or Cobra is not installed.

Before you tried the Cobra addin for MonoDevelop, were you able to use Cobra from the command line to compile and run Cobra programs? If you're not sure if you have Cobra installed correctly, check to see if you have a 'C:\Cobra\bin\cobra.bat' file.
wrechtin
 
Posts: 4

Re: Creating A Project in Cobra

Postby nerdzero » Thu Jan 17, 2013 7:47 pm

Hi will,

The closest thing to beginner-like info is probably this page: http://cobra-language.com/docs/hello-world/

Cobra is definitely my favorite programming language, but it may not be the best language to start with if you are brand new to programming only because a lot of the documentation assumes you have some familiarity with other languages or programming in general. I don't want to discourage you from learning programming though because it's really awesome and fun.

Unfortunately, the MonoDevelop addin instructions may now have left you with a non-beginner friendly installation for Cobra depending on what was successful and what was not. I can get you up and running, but it will take some patience from you...right DelphiGuy? :D

Send me a private message by clicking my username so the back and forth of "run this command...", "what's the output?", "now run this command..." etc. type of messages won't annoy everybody.

-Ramon
nerdzero
 
Posts: 286
Location: Chicago, IL

Re: Creating A Project in Cobra

Postby bertpritchard » Fri Jan 18, 2013 6:39 am

I've recently gone through the installation process for Cobra and the Monodevelop plugin. After a little configuration, it is working great for me. I went through the same process of having to reinstall because of the 64bit system. So it is fresh in my mind.

It does sound like cobra is missing from your path. In case it helps, below are the steps to add Cobra to your Path variable (Windows 7):

    Click the "Start" button
    Choose "Control Panel"
    Click "System and Security"
    On the right side list click "System" (3rd one down)
    On the left side list click "Advanced system settings" (should be the last item on the list)
    A System Properties box will pop up. Near the bottom click the "Environment Variables" button
    In the System variables box at the bottom you should see a Variable named "Path" (you may need to scroll to find it)
    Click on the path variable and then click the "Edit..." button
    This part is important:
      You should keep the text already there. Since the text will be highlighted, first click in the text field.
      Press the End key on your keyboard to take you to the end of the text.
      Paste in the following (including the semicolon) ;C:\Cobra\bin
      Click the "OK" button.
      Click the "OK" button on the Environment Variables window.
      Click the "OK" button on the System Properties window.
    Finally, launch a new command prompt and see if you can access cobra by typing cobra -version

If you run into issues after doing this, please let us know. We're happy to help. :)

-bp
bertpritchard
 
Posts: 7

Re: Creating A Project in Cobra

Postby nerdzero » Fri Jan 18, 2013 11:16 am

Awesome, bert. I spend most of my time in Ubuntu these days. Will, let us know how it goes.
nerdzero
 
Posts: 286
Location: Chicago, IL

Next

Return to Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron