473,378 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Need Simple Looping Help

I want to know if it is possible to make the design below in a picture box with loops instead of just writing....
picture1.print "*****"
picture1.print "****"
picture1.print "***"
etc...

The shape i am looking for is a triangle flipped vertically like so
* * * * *
- * * * *-
--* * *--
--- * *---
----* ----
Ty.


ps. the _ means spaces
Oct 29 '07 #1
1 974
kadghar
1,295 Expert 1GB
I want to know if it is possible to make the design below in a picture box with loops instead of just writing....

ps. the _ means spaces
Well if you can find a "function" that makes each line, i think its possible. For this very case, where you want to start with n times a * and each time you replace the first * with a space and add another space at the end, something like this should help

Expand|Select|Wrap|Line Numbers
  1. dim Str1 as string
  2. dim Str2 as string
  3. dim i as integer
  4. dim n as integer
  5. 'lets say n=10
  6. n=10
  7. str1=string(n, "*")
  8. str2=str1
  9. for i = 2 to n
  10.     str1 = string(i - 1, " ") & mid(str1, i) & " "
  11.     str2 = str2 & chr(10) & str1
  12. next
  13. 'then just print it..
  14. msgbox str2
It can also be done using InStr.
But almos in every case, you wont be able to do this and you'll have to write line by line
HTH
Oct 29 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

31
by: da Vinci | last post by:
OK, this has got to be a simple one and yet I cannot find the answer in my textbook. How can I get a simple pause after an output line, that simply waits for any key to be pressed to move on? ...
3
by: Oleg Ogurok | last post by:
Hi all, I'm trying to write a simple Windows Service that will "do something" at a given time, for example call a method at 5pm. What's the easiest way to schedule a task like that in C# ? All I...
8
by: moondaddy | last post by:
I'm writing an app in vb.net 1.1 and I need to parse strings that look similar to the one below. All 5 rows will make up one string. I have a form where a use can copy/paste data like what you...
2
by: rh0dium | last post by:
Hi all, Why doesn't this work as expected.. I expect that the the lines within the sections will get modified - permanently. It is modifying them during the first section but they never get...
43
by: SLH | last post by:
hi people. im trying to validate input received via a text area on an ASP page before writing it to a database. i cant use client side javascript due to policy, so it all has to happen on the...
21
by: asif929 | last post by:
I need immediate help in writing a function program. I have to write a program in functions and use array to store them. I am not familiar with functions and i tried to create it but i fails to...
1
by: darrel | last post by:
Hi vb master i need help on this here my code: If Combo1(0) = rs.Fields("TimeStart") And Combo4(0) = rs.Fields("TimeEnd") And Combo2(0) = rs.Fields("ROOM") And Combo3(0) = rs.Fields("DAYS")...
2
by: halo combat22 | last post by:
I need to create a program that asks the user for the beginning and ending numbers in a range. The computer will then display the sum of the entire range. For example: if the user inputted 2 and 5,...
5
by: Justin | last post by:
Here's my XML: <?xml version="1.0" ?> <AppMode Type="Network"> <CurrentFolder Path="c:\tabs"> <Tabs> <FilePath>tabs\Justin.tab</FilePath> <FilePath>tabs\Julie.tab</FilePath> *****There could...
1
by: vijayarl | last post by:
Hi Everyone, i have the written this logic : basically a file operation open (CONFIGFILE, "$config_file") or die; while (<CONFIGFILE>) { chomp;
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.