Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Error : Method name expected // how do I fix this error. please

Error : Method name expected // how do I fix this error. please

Scheduled Pinned Locked Moved C#
helpcsharpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member 10743422
    wrote on last edited by
    #1

    C# Code using System; using System.Collections; namespace Loop_Test { public class ForLoopTest { static void Main() { int Ticks = 0; int Bit = 0; int Ask = 0; int Bar1 = 22; for(int i = 0; i < 22 ( Bit + Ask) ; i++) Console.WriteLine("Bar1"); } } } This is one of bar from 22 Ticks ,Stock bar chart (Bid,Ask,Open,High,Low, Close). When bar close must have Variable (Bit&Ask) Total= 22; Can somebody help me with this loop. David.

    R L 2 Replies Last reply
    0
    • M Member 10743422

      C# Code using System; using System.Collections; namespace Loop_Test { public class ForLoopTest { static void Main() { int Ticks = 0; int Bit = 0; int Ask = 0; int Bar1 = 22; for(int i = 0; i < 22 ( Bit + Ask) ; i++) Console.WriteLine("Bar1"); } } } This is one of bar from 22 Ticks ,Stock bar chart (Bid,Ask,Open,High,Low, Close). When bar close must have Variable (Bit&Ask) Total= 22; Can somebody help me with this loop. David.

      R Offline
      R Offline
      Richard Berry100
      wrote on last edited by
      #2

      A few things: 1) Do you want to loop until (Bit + Ask) = 22? 2) The value of Bit,Ask and Bar1 are not changing from 0 3) If you want to display the value of Bar1 then you should put Console.WriteLine(Bar1.ToString()); (Console.WriteLine("Bar1") will display 'Bar1' and not the value of the variable Bar1)

      for (int i = 0; (Bit + Ask) < 22; i++)
      {
      //Do something here to change the value of Bit and Ask - else infinite loop!!!
      Console.WriteLine(Bar1.ToString());
      }

      1 Reply Last reply
      0
      • M Member 10743422

        C# Code using System; using System.Collections; namespace Loop_Test { public class ForLoopTest { static void Main() { int Ticks = 0; int Bit = 0; int Ask = 0; int Bar1 = 22; for(int i = 0; i < 22 ( Bit + Ask) ; i++) Console.WriteLine("Bar1"); } } } This is one of bar from 22 Ticks ,Stock bar chart (Bid,Ask,Open,High,Low, Close). When bar close must have Variable (Bit&Ask) Total= 22; Can somebody help me with this loop. David.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        I suggest reading http://www.charlespetzold.com/dotnet/[^].

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups