Wealth-Lab Wiki

API ChartStyles Community Components Community Indicators IndexDefinitions Knowledge Base Misc Optimizers Pending Deletion PosSizers Providers Standard Indicators TASC Traders Tips TASCIndicators Tutorial Videos Visualizers
RSS

Navigation


Quick Search
»
Advanced Search »


Syntax


public static string Input(this WealthScript obj)
public static string Input(this WealthScript obj, string prompt)
public static string Input(this WealthScript obj, string prompt, string title, string defaultText, int HPos, int VPos)

public static string Input() public static string Input(string prompt) public static string Input(string prompt, string title, string defaultText, int HPos, int VPos)

Parameter Description

(optional) promptDialog prompt
(optional) titleDialog window title
(optional) HPosDistance in pixels of the left edge of the dialog box from the left edge of the screen
optional) VPosDistance in pixels of the upper edge of the dialog box from the top of the screen
(optional) promptThe message to be displayed in the dialog box

Description

Displays an input dialog where the user can enter a value, which is always returned as a string type, that is returned by the function. The 2 overloaded calls provide a number of optional parameters to customize the dialog.

For ease of use, Input is a static wrapper function for .NET's Interaction.InputBox method found in Microsoft.VisualBasic namespace.

Example

This example illustrates how to use the Input function to manually specify several symbols and find the DataSets they can be found in:

Example using C# extension methods + Legacy syntax (commented out):


using System;
using System.Windows.Forms;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;

namespace WealthLab.Strategies { public class SearchForClickedSymbol : WealthScript { protected override void Execute() { ClearDebug(); DataSourceManager dm = new WealthLab.DataSourceManager(); dm.RootPath = Application.UserAppDataPath + @"\Data\";

string s = string.Empty; string[] symbols = this.Input().ToUpper().Split(',', ';', ' '); //string[] symbols = Community.Components.Utility.Input().ToUpper().Split(',', ';', ' '); foreach( string sym in symbols ) s += String.Concat( sym, "," ); PrintDebug("Searching for " + s + "..." ); foreach(DataSource ds in dm.DataSources) { foreach (string str in symbols) if (ds.Symbols.Contains(str)) PrintDebug( "Found " + str + " in " + ds.Name ); } } } }

Important Disclaimer: The information provided by Wealth-Lab is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security.  The owner of Wealth-Lab.com assumes no liability resulting from the use of the material contained herein for investment purposes. By using this web site, you agree to the terms of this disclaimer and our Terms of Use.

Used under license from FMR Corp. Copyright 2008 FMR Corp. All rights reserved.


ScrewTurn Wiki. Some of the icons created by FamFamFam.